lighttpd 日志格式设置

来源:互联网 发布:c语言头文件怎么写 编辑:程序博客网 时间:2024/06/04 18:37
lighttpd的日志格式是可以自己定义的,通过在lighttpd 的配置文件 lighttpd.conf 中通过 accesslog.format 参数来指定

支持的参数含义如下:

 

%%     a percent sign%h     name or address of remote-host%l     ident name (not supported)%u     authenticated user%t     timestamp of the end-time of the request%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%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


参数示例:
accesslog.format = "%h %l %u %t \"%m http://%v%U?%q %H\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{my_uniq_ckid}C\""

 日志内容示例:

127.0.0.1 - - [28/Apr/2012:17:42:50 +0800] "GET http://www.sample.com/? HTTP/1.1" 200 0 "-" "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; InfoPath.2)" "-"

原创粉丝点击