How can I print a log in VCL?
Can I print log info on screen?
Can I do like this?
sub vcl_recv {
....
log.info(req.http.host); // can i write a log here?
....
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can see URL with requested URLs varnishlog utility (it able to write log files)
Or output some info to syslog with vmod std and syslog function for
Varnish 3.x https://www.varnish-cache.org/docs/trunk/reference/vmod_std.html#syslogVarnish 5.1 https://varnish-cache.org/docs/5.1/reference/vmod_std.generated.html#func-syslogExample:
Or with C-snippet on Varnish 2.x https://www.varnish-cache.org/trac/wiki/VCLExampleSyslog