Debug

Geoff Simmons geoff at uplex.de
Thu Feb 9 10:55:38 CET 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On Wed, Feb 8, 2012 at 10:04 AM, Robson Roberto Souza Peixoto
 <robsonpeixoto at gmail.com <mailto:robsonpeixoto at gmail.com>> wrote:
> 
> Are there a command to keep easier the process of debug a vcl ? 
> Something like write in log.

On 2/8/12 7:42 PM, Damon Snyder wrote:
> You can always in-line C and write to syslog. I found that handy 
> (varnish 2.1.5) when we were doing some custom affinity hashing
> for serving images. You can do something like:
> 
> # add this to the top of your vcl C{ #include <syslog.h> #include
> <stdio.h> }C
> 
> sub vcl_recv { # or other ...
> 
> # in some section you want to debug const char * url =
> VRT_r_req_url(sp); syslog(LOG_INFO, "varnish %s ...", url);
> 
> ... }

If you're in Varnish 3.x, you can just use the standard VMOD and call
log() (to log into varnishlog) or syslog():

https://www.varnish-cache.org/docs/3.0/reference/vmod_std.html#log


Best,
Geoff
- -- 
UPLEX Systemoptimierung
Schwanenwik 24
22087 Hamburg
http://uplex.de/
Mob: +49-176-63690917
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.14 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJPM5gYAAoJEOUwvh9pJNUReLoP/jgP2IP/anStrLGhSczAKEOF
UAoiwuX+U8eIu9x2CrgL1q+KdTVJ1ljR6ho/mTxrs1YUiUOSMOp7PScpiIE/ytMv
UnL1SeaV8Q0+c+z/tHcZSWXfzeVDLcTRyVQSbWkVylefMqL2+I9HNT1raQ42zTst
geD+NwGfPHU1VTiUl+Al+c8t37MkY+sUDHJNyzHjCqlUAgUmUS5+ruerMZR+5I3D
ggaqE8JjHfJF0TOsO27a8RmcQ94kyeESztLHIA3Kgn3zdkcdJeC9vqFI1SaYWnPB
BFXbWzb6cRjvts3md3zbZOL4UHOGjUD7J9KTl50HFT2LSEbCDbXPPkC5meNvfOPG
INIPspScUDyrsIsUkeAXkXal0nKU/Oko+VQyTcD1JkScad7TqgiLPgmcJqPYWp3B
FctNN9FJ0002N/bARkmHTVScxwE5M+ajimJkabiq1eC6EGxYSc9H6BOMzrz28VeC
TaZUAx0wQ32FXOxwwIBh9ECWkgLzCmN+1kRABIQuSf6zgr/naOV9un3eAo24LgMy
9dUCWZxSri8sW6qz9AEwRUtmZtyWd8wToy33+WOi0AWUCl8yzH/X90WPSKK+HlEt
OTmAuPkhgB+gmY7/gf0BgOCx4AdxpLnqnFny4K1TgKwFm1+rYpD/zEH1GyXd8XFy
Ut+ZkyBpcg9w6RMqdbFr
=bDN/
-----END PGP SIGNATURE-----



More information about the varnish-misc mailing list