Setup logging for Varnish – The right way

Initially, logging Varnish didn’t really work that well. Varnish, by default, doesn’t log (varnishncsa can do some logging, but I haven’t figured that out yet.) I’ve been parsing my logs with JAWstats, which reads the Apache logs. However, by default, varnish will replace the IP address of the originating client with the IP address of …

Continue reading ‘Setup logging for Varnish – The right way’ »

Updated Varnish default.vcl

I wasn’t able to get the varnish logs in a format awstats/jawstats could understand. After a LOT of googling, I’ve gotten this to work. I added sub vcl_recv { # Add a unique header containing the client address remove req.http.X-Forwarded-For; set req.http.X-Forwarded-For = client.ip; }sub vcl_recv { # Add a unique header containing the client …

Continue reading ‘Updated Varnish default.vcl’ »