Debugging Varnish VCL configuration files | Midwestern Mac, LLC
This entire article’s worth a read, but the ability to log from VCL files dirctly to the system log is what drew my attention
In your VCL (at the top), add in import std; to import the std library. Then, anywhere in the vcl, you can log messages to the system log using something like:
std.syslog(0, req.http.Cookie);