Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Misc

Debug

 

 

Varnish misc RSS feed   Index | Next | Previous | View Threaded


robsonpeixoto at gmail

Feb 8, 2012, 10:04 AM

Post #1 of 4 (783 views)
Permalink
Debug

Hi,

Are there a command to keep easier the process of debug a vcl ? Something
like write in log.

thanks
--
Robson Roberto Souza Peixoto
Robinho
Master in Computer Science, University of Campinas
Linux Counter #395633
IRC: robsonpeixoto
Twitter: http://twitter.com/rrspba
github: https://github.com/robsonpeixoto


damon at huddler-inc

Feb 8, 2012, 10:42 AM

Post #2 of 4 (757 views)
Permalink
Re: Debug [In reply to]

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);

...
}

Hope that helps.

Damon


On Wed, Feb 8, 2012 at 10:04 AM, Robson Roberto Souza Peixoto <
robsonpeixoto [at] gmail> wrote:

> Hi,
>
> Are there a command to keep easier the process of debug a vcl ? Something
> like write in log.
>
> thanks
> --
> Robson Roberto Souza Peixoto
> Robinho
> Master in Computer Science, University of Campinas
> Linux Counter #395633
> IRC: robsonpeixoto
> Twitter: http://twitter.com/rrspba
> github: https://github.com/robsonpeixoto
>
> _______________________________________________
> varnish-misc mailing list
> varnish-misc [at] varnish-cache
> https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc
>


geoff at uplex

Feb 9, 2012, 1:55 AM

Post #3 of 4 (754 views)
Permalink
Re: Debug [In reply to]

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

On Wed, Feb 8, 2012 at 10:04 AM, Robson Roberto Souza Peixoto
<robsonpeixoto [at] gmail <mailto:robsonpeixoto [at] gmail>> 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-----

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


robsonpeixoto at gmail

Feb 9, 2012, 3:05 AM

Post #4 of 4 (752 views)
Permalink
Re: Debug [In reply to]

Thanks. Excellent tips.

[ ]s

On Thu, Feb 9, 2012 at 7:55 AM, Geoff Simmons <geoff [at] uplex> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
>
> On Wed, Feb 8, 2012 at 10:04 AM, Robson Roberto Souza Peixoto
> <robsonpeixoto [at] gmail <mailto:robsonpeixoto [at] gmail>> 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-----
>



--
Robson Roberto Souza Peixoto
Robinho
Master in Computer Science, University of Campinas
Linux Counter #395633
IRC: robsonpeixoto
Twitter: http://twitter.com/rrspba
github: https://github.com/robsonpeixoto

Varnish misc RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.