Apache 一般有两种日志格式:
通用日志格式(Common Log Format) 和 组合日志格式(Combined Log Format)
http.conf中默认格式如下:
LogFormat “%h %l %u %t \”%r\” %>s %b” common
LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-agent}i\”” combined
也可以使用自定义,这里使用`分隔 日志参数
%h`%l`%u`%{%Y-%m-%d %H:%M:%S}t`%r`%s`%b`%{Referer}i`%{User-Agent}i`%{X-Up-Calling-Line-ID}i
输出结果如下:
127.0.0.1 – frank [10/Oct/2000:13:55:36 -0700] “GET /apache_pb.gif HTTP/1.0″ 200 2326
127.0.0.1 – frank [10/Oct/2000:13:55:36 -0700] “GET /apache_pb.gif HTTP/1.0″ 200 2326 “http://www.example.com/start.html” “Mozilla/4.08 [en] (Win98; I ;Nav)”
172.16.0.115`-`-`2008-03-13 11:00:03`GET /logo.gif HTTP/1.1`200`2893`http://172.16.0.252/index.jsp `Opera/9.26 (Windows NT 5.1; U; zh-cn)`- Continue reading »