Syslog with inline C

Poul-Henning Kamp phk at
Tue Jan 20 13:06:00 CET 2009

In message <20090120110500.GA33398 at>, Anders Nordby writes:
>I want to use syslog() two places in vcl_recv.
>If I put this one two places:
>	#include <syslog.h>
>	syslog(LOG_ERR, "Bogus request: %s/%s", VRT_GetHdr(sp, HDR_REQ, "\005host:"), VRT_r_req_url(sp));

Outside of any subroutine, you must do the includes, and the calls obviously
from inside:

	#include <syslog.h>

	sub vcl_recv {
		syslog(LOG_ERR, "foobar");

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-misc mailing list