lighttpd 日志格式设置

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值