On 19.10.2011 19:25, Hugo Cisneiros (Eitch) wrote:

> I use syslog to do it. When a request goes to vcl_error, I log it,
> including the status of the object for example. It's a bit more
> difficult to do (since it uses C variables, not VCL language ones),
> but works very fine.

varnish 3.x implements a syslog function via the std vmod.

|import std;
|
|vcl_error {
|  if (obj.status >= 500) {
|    std.syslog(180, "Error (" + req.url + ") (" + obj.response + ") ("
+ req.xid + ")");
|  }
|}

I couldn't find the LOG_* constants defined in the VCL scope, so I use
integer literals here.

References:
https://www.varnish-cache.org/docs/trunk/reference/vmod_std.html



Hauke.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
varnish-misc mailing list
[email protected]
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc

Reply via email to