[Varnish] #485: Virtualhost logging for varnishncsa

Varnish varnish-bugs at projects.linpro.no
Tue Apr 7 11:09:16 CEST 2009


#485: Virtualhost logging for varnishncsa
---------------------------------------------------------+------------------
 Reporter:  rhalff                                       |        Type:  enhancement
   Status:  new                                          |    Priority:  normal     
Milestone:                                               |   Component:  varnishncsa
  Version:  trunk                                        |    Severity:  normal     
 Keywords:  varnishncsa, virtual hosts, apache, logging  |  
---------------------------------------------------------+------------------
 Hi,

 I've changed the varnishncsa sourcecode to support virtualhost logging.

 I know in the TODO of varnishncsa there is a future wish for "Log in
 any format one wants",
 but I can imagine that would need a total rewrite and takes some time.

 So in the meantime I have a request to add the virtualhost logging as
 a commandline option.

 I've added  a -v flag enabling virtualhost style logging
 In this case the logformat looks like:

 $ varnishncsa -v
 www.test.nl 111.222.333.44 - - [03/Apr/2009:11:41:57 +0200] "GET
 /favicon.ico HTTP/1.1" 404 209 "-" "Mozilla/4.0
 (compatible; MSIE 7.0; Windows NT 5.1; GTB5)"

 Notice the 'www.test.nl' being logged.

 This is the equivalent of this kind apache logging:

 http://httpd.apache.org/docs/2.0/vhosts/mass.html#simple :

     LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon

 http://httpd.apache.org/docs/2.0/vhosts/mass.html#simple.rewrite :

     LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon

 So this adds the Host part to the normal kind of logging ncsa is doing.

 Taken that this is a very common way to log virtual hosts I would say
 the -v option is not just some hack to suit my own needs, I think it
 is usefull for others also.

 Without this I am not able to use awstats the way we used it when we
 where not using varnish.

 Attached you will find the diff against the current trunk.

 Greetings,
 Rob Halff

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/485>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list