apache 日志显示来源,浏览器信息

    上次刚装了APACHE ,其他运行正常,但是发现日志文件,显示信息默认的太少,连浏览器和蜘蛛的来路都没法看到,其实我看网站的日志基本看的就是蜘蛛的活动量,网少找了资料,终于将APACHE 的日志设置弄完成了。

可以使用如下的格式

LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-agent}i"" combined

CustomLog logs/access.log combined

显示的日志格式为

202.160.179.63 – – [09/Dec/2007:02:22:21 +0800] "GET /health/jibing/x/wangxiangzheng/2549.html HTTP/1.0" 200 8624 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)"
202.160.178.244 – – [09/Dec/2007:02:30:46 +0800] "GET /health/jibing/x/yiyuzheng/2245_2.html HTTP/1.0" 200 10944 "-" "Mozilla/5.0 (compatible; Yahoo! Slurp China; http://misc.yahoo.com.cn/help.html)"
61.135.166.230 – – [09/Dec/2007:02:32:28 +0800] "HEAD /health/lady/huli/781.html HTTP/1.1" 200 – "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
61.135.166.230 – – [09/Dec/2007:02:32:32 +0800] "HEAD /health/lady/huli/797.html HTTP/1.1" 200 – "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"
61.135.166.230 – – [09/Dec/2007:02:32:32 +0800] "HEAD /health/xinli/xinlichangshi/1103.html HTTP/1.1" 200 – "-" "Baiduspider+(+http://www.baidu.com/search/spider.htm)"

发表评论

邮箱地址不会被公开。 必填项已用*标注

click to changeSecurity Code