Docs ModAccessLog » History » Revision 11

Revision 10 (at2000, 2007-07-29 11:25) → Revision 11/35 (Anonymous, 2007-12-03 17:01)


 Module: mod_accesslog 

 .. meta:: 
   :keywords: lighttpd, accesslog, CLF 
 .. contents:: Table of Contents 


 CLF like by default, flexible like apache 


   send the accesslog to syslog 
   Default: disabled 

   name of the file where the accesslog should be written to if syslog 
   is not used. 
   if the name starts with a '|' the rest of the name is taken 
   as the name of a process which will be spawned and will get the 
   e.g.: :: 
     accesslog.filename = "/var/log/lighttpd.log" 
     $HTTP["host"] == "" { 
       accesslog.filename = "|/usr/bin/cronolog" 

   if you have multiple workers on 1.4.x (now, the current version) 
   and want all access logs to be written (without that, only one worker will write logs), use  
   the accesslog.filename = "\|/usr/sbin/cronolog.. (as a temporary solution) 
   Default: disabled 

   the format of the logfile 
   ====== ================================ 
   Option Description 
   ====== ================================ 
   %%       a percent sign 
   %h       name or address of remote-host 
   %l       ident name (not supported) 
   %u       authenticated user 
   %t       timestamp for the request-start 
   %r       request-line  
   %s       status code  
   %b       bytes sent for the body 
   %i       HTTP-header field 
   %a       remote address 
   %A       local address 
   %B       same as %b 
   %C       cookie field (not supported) 
   %D       time used in ms (not supported) 
   %e       environment (not supported) 
   %f       physical filename 
   %H       request protocol (HTTP/1.0, ...) 
   %m       request method (GET, POST, ...) 
   %n       (not supported) 
   %o       `response header`_ 
   %p       server port 
   %P       (not supported) 
   %q       query string 
   %T       time used in seconds 
   %U       request URL 
   %v       server-name 
   %V       HTTP request host name 
   %X       connection status 
   %I       bytes incomming 
   %O       bytes outgoing 
   ====== ================================ 
   If %s is written %>s or %<s the < and the > are ignored. They are support 
   for compat with apache.  

   %h will always return the IP address of the host, never the name. This makes it equivalent to %a, which is not implements. 

   %a, %A, %{name}C, %D and %e are all unimplemented as of 1.4.18 and 1.5.0-r1922 
   %i and %o expect the name of the field which should be written in curly brackets. 
   e.g.: :: 
     accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{Referer}i\" \"%{User-Agent}i\"" 
   Default: CLF compatible output.    Format from 1.4.13 source: ``"%h %V %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\""``    The difference between Apache's CLF is the second field changes from ``%l`` to ``%V``. 

 Response Header 

 The accesslog module provides a special way to log content from the 
 application in a accesslog file. It can be used to log the session id into a 

 If you want to log it into the accesslog just specify the field-name within 
 a %{...}o like :: 

   accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{Referer}i\" \"%{User-Agent}i\" \"%{X-LIGHTTPD-SID}o\"" 
 The prefix ``X-LIGHTTPD-`` is special as every response header starting with 
 this prefix is assumed to be special for lighttpd and won't be sent out 
 to the client.  

 An example the use this functionality is provided below: :: 

   header("X-LIGHTTPD-SID: ".session_id());