logging errors in varnish 4

Jason Price japrice at gmail.com
Tue Aug 4 23:38:56 CEST 2015


Thank you.  This can work.

(yes, syslog is slow.  It's only triggered for certain kinds of errors)

On Tue, Aug 4, 2015 at 1:59 AM, Andreas Plesner <apj at mutt.dk> wrote:

> On Mon, Aug 03, 2015 at 06:16:17PM -0400, Jason Price wrote:
>
> > In varnish 3, I did the following to log odd errors to syslog:
> >
> >         std.syslog((3*8)+5, "returning backend error page. client.ip is
> " +
> > client.ip +
> >                " req.xid is " + req.xid +
> [...]
> > Am I missing something?
>
> You're right that client is not accessible in backend functions (for IMS
> there
> may not even be a client), however bereq.* should be a fine replacement for
> req.*.
> You could also just put the log in the client side of things, i.e. in
> vcl_deliver, where you have access to req.* and client.*
>
> Also, syslog is a poor choice performance-wise. The correct solution is,
> and
> has always been, to monitor the shared memory log.
>
> --
> Andreas
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc at varnish-cache.org
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20150804/6560eaa3/attachment.html>


More information about the varnish-misc mailing list