I'm trying to read log files of Varnish server in Ubuntu environment.

I actually never used Varnish before.

so...I cd to /var/log/varnish, but the folder is empty.

it tells me that I have to configure my varnish server to save logs...is that true?

2 Answers 2


by default varnish will not log anywhere.. you have to run a command to get it to show logs

You can run the command


For more info on how to use that command to write to a log instead of stdout


  • 33
    The most stupid name for log command that you would never guess.
    – pronebird
    Nov 24, 2015 at 17:55
  • I looked all over the internet for this. Not only is it a difficult name, it's also buried deep where no one can find it. Oct 17, 2016 at 18:50
  • 2
    You can also do service varnishncsa start Jun 1, 2017 at 3:35
  • ncsa goes back to pre-apache webserver and is the name of the log format loganalyzer.net/log-analyzer/apache-combined-log.html. I agree though it's a stupid name
    – Mike
    Aug 23, 2019 at 14:01

We could use varnishlog too, a better remembered name compared with varnishncsa.

We need run it with root privilege - sudo varnishlog, otherwise somethime it will said VSM: Could not get hold of varnishd, is it running?.

For writing log to file, we could run sudo varnishlog -w <filename>.

-w <filename>
Redirect output to file.
The file will be overwritten unless the -a option was specified.
If the application receives a SIGHUP in daemon mode the file will be reopened allowing the old one to be rotated away.
The file can then be read by varnishlog and other tools with the -r option, unless the -A option was specified. This option is required when running in daemon mode.

For reading the log file, we could run sudo varnishlog -r <filename>.

-r <filename>
Read log in binary file format from this file. The file can be created with varnishlog -w filename.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.