1========= 2Accesslog 3========= 4 5--------------------- 6Module: mod_accesslog 7--------------------- 8 9:Author: Jan Kneschke 10:Date: $Date: 2004/11/03 22:26:05 $ 11:Revision: $Revision: 1.2 $ 12 13:abstract: 14 The accesslog module ... 15 16.. meta:: 17 :keywords: lighttpd, accesslog, CLF 18 19.. contents:: Table of Contents 20 21Description 22=========== 23 24CLF like by default, flexible like apache 25 26Options 27======= 28 29accesslog.use-syslog 30 send the accesslog to syslog 31 32 Default: disabled 33 34accesslog.filename 35 name of the file where the accesslog should be written too if syslog 36 is not used. 37 38 if the name starts with a '|' the rest of the name is taken 39 as the name of a process which will be spawn and will get the 40 output 41 42 e.g.: :: 43 44 accesslog.filename = "/var/log/lighttpd.log" 45 46 $HTTP["host"] == "mail.example.org" { 47 accesslog.filename = "|/usr/bin/cronolog" 48 } 49 50 Default: disabled 51 52accesslog.format 53 the format of the logfile 54 55 ====== ================================ 56 Option Description 57 ====== ================================ 58 %% a percent sign 59 %h name or address of remote-host 60 %l ident name (not supported) 61 %u authenticated user 62 %t timestamp for the request-start 63 %r request-line 64 %s status code 65 %b bytes sent for the body 66 %i HTTP-header field 67 %a remote address 68 %A local address 69 %B same as %b 70 %C cookie field (not supported) 71 %D time used in ms (not supported) 72 %e environment (not supported) 73 %f phyiscal filename 74 %H request protocol (HTTP/1.0, ...) 75 %m request method (GET, POST, ...) 76 %n (not supported) 77 %o `response header`_ 78 %p server port 79 %P (not supported) 80 %q query string 81 %T time used in seconds 82 %U request URL 83 %v server-name 84 %V (not supported) 85 %X connection status 86 %I bytes incomming 87 %O bytes outgoing 88 ====== ================================ 89 90 If %s is written %>s or %<s the < and the > are ignored. They are support 91 for compat with apache. 92 93 %i and %o expect the name of the field which should be written in curly brackets. 94 95 e.g.: :: 96 97 accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{User-Agent}i\" \"%{Referer}i\"" 98 99 Default: CLF compatible output 100 101Response Header 102--------------- 103 104The accesslog module provides a special way to log content from the 105application in a accesslog file. It can be used to log the session id into a 106logfile. 107 108If you want to log it into the accesslog just specify the field-name within 109a %{...}o like :: 110 111 accesslog.format = "%h %l %u %t \"%r\" %b %>s \"%{User-Agent}i\" \"%{Referer}i\" \"%{X-LIGHTTPD-SID}o\"" 112 113The prefix ``X-LIGHTTPD-`` is special as every response header starting with 114this prefix is assumed to be special for lighttpd and won't be sent out 115to the client. 116 117An example the use this functionality is provided below: :: 118 119 <?php 120 121 session_start(); 122 123 header("X-LIGHTTPD-SID: ".session_id()); 124 125 ?> 126 127