log action in VCL

Poul-Henning Kamp phk at phk.freebsd.dk
Sat May 15 12:51:22 CEST 2010

In message <87bpcia6d1.fsf at qurzaw.linpro.no>, Tollef Fog Heen writes:

>We've talked about having a =C2«log=C2» action in VCL for the longest time,
>so I implemented it.  Patch attached.  I'm not entirely happy about the
>name of the shmlog tag, but I can live with VCL_Log.

I think VCL_Log is pretty OK for a name, I certainly cannot come up with
a better one right now.

The patch looks OK.

One of the reasons I have not done this myself yet, is that I would
like to have the log message contain a back-vector to the source,
but have not found a good way of doing that.

It is already possible to have more than one VCL in play at the
same time, and it may become even more so soonish, and since
the VCL_Log is very likely to be used for debugging, I really
hate the scenario where log messages from one VCL version confuses
people working on a newer one.

The absolute coords of a VCL source token is presently <vcl_name,
src_file, line, char> which is far too verbose for my taste.

We could add a log-record per request, that tells which VCL this
is being processed by, that would eliminate the first element of
the set, leaving only a numeric triplet for the ID.

Thoughts welcome...

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.

More information about the varnish-dev mailing list