0
vcl 4.1;

import std;

backend default {
  .host = "127.0.0.1";
  .port = "80";
}

sub vcl_recv {

    std.syslog(2, "debugging : " + req.url);

}

I have this config and I am using the varnish:6.2 image in my docker-compose and I can't get any log when I do docker-compose exec varnish bash and use varnishlog, and I don't see the syslog anywhere. Is there a place where I can get it? Also, I would like to see the logs in real time inside Docker Desktop, how do I debug my output there?

1 Answer 1

2

There's no elegant solution for this, unless you can configure your syslog on the container to output it to STDOUT/STDERR.

Another solution is to run a sidecar container that runs the varnishlog or varnishncsa command. This will send logs to STDOUT. This will be accessible through docker logs.

In order to do this the /var/lib/varnish should be shared as a volume from your Varnish container and also mounted into the sidecar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .