无标题文档
wdCP系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdCDN系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
wdOS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用教程) wdDNS系统 (介绍,功能特性,运行环境,安装说明,演示,常见问题,使用手册)
注册 发贴 提问 回复-必看必看 wddns免费智能 DNS 开通 本地或虚拟机使 用wdcp 一键包在mysql编 译时"卡住"
【300G高防】双线 无视攻击 wdcp官方技术支持/服务 阿里云8折优惠券 无敌云 腾讯云优惠中,现注册更有260代金额券赠送
返回列表 发帖
提问三步曲: 提问先看教程/FAQ索引(wdcp,wdcp_v3,一键包)及搜索,会让你更快解决问题
1 提供详细,如系统版本,wdcp版本,软件版本等及错误的详细信息,贴上论坛或截图发论坛
2 做过哪些操作或改动设置等

温馨提示:信息不详,很可能会没人理你!论坛有教程说明的,也可能没人理!因为,你懂的

[求助] 如何更改APACHE日志的格式?

近日想更改APACHE日志的格式,使其能记录访客的User-Agent信息到日志里,但是百度了很多资料,还是没能学会

现在的日志记录下来是这样:
  1. 10.1.1.95 - e800 [18/Mar/2005:12:21:42 +0800] "GET /stats/awstats.pl?config=e800 HTTP/1.1" 200 899
复制代码


我想改成这样:
  1. 10.1.1.95 - e800 [18/Mar/2005:12:21:42 +0800] "GET /stats/awstats.pl?config=e800 HTTP/1.1" 200 899 "http://10.1.1.1/pv/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; Maxthon)"
复制代码


哪位大哥知道怎么修改呢?







以下为小弟http.conf的部分信息,不知道是不是改这里?
  1. <IfModule log_config_module>
  2.     #
  3.     # The following directives define some format nicknames for use with
  4.     # a CustomLog directive (see below).
  5.     #
  6.     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  7.     LogFormat "%h %l %u %t \"%r\" %>s %b" common
  8.     <IfModule logio_module>
  9.       # You need to enable mod_logio.c to use %I and %O
  10.       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  11.     </IfModule>
  12.     #
  13.     # The location and format of the access logfile (Common Logfile Format).
  14.     # If you do not define any access logfiles within a <VirtualHost>
  15.     # container, they will be logged here.  Contrariwise, if you *do*
  16.     # define per-<VirtualHost> access logfiles, transactions will be
  17.     # logged therein and *not* in this file.
  18.     #
  19.     CustomLog "logs/access_log" common
  20.     #
  21.     # If you prefer a logfile with access, agent, and referer information
  22.     # (Combined Logfile Format) you can use the following directive.
  23.     #
  24.     #CustomLog "logs/access_log" combined
  25. </IfModule>
复制代码

CustomLog "logs/access_log" common
改为
CustomLog "logs/access_log" combined
就可以
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

回复 2# admin


    非常感谢

TOP

回复 2# admin


    老大,我试着更改重启了还是不行哦,是不是我改错哪里了,麻烦老大帮忙在看一下

我更改后,日志还是这样子的
  1. 95.211.139.1 - - [09/Jun/2012:23:16:04 +0800] "GET /store/shoplist-14.html HTTP/1.0" 200 -
复制代码



最后附httpd.conf

  1. <IfModule log_config_module>
  2.     #
  3.     # The following directives define some format nicknames for use with
  4.     # a CustomLog directive (see below).
  5.     #
  6.     LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
  7.     LogFormat "%h %l %u %t \"%r\" %>s %b" common
  8.     <IfModule logio_module>
  9.       # You need to enable mod_logio.c to use %I and %O
  10.       LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
  11.     </IfModule>
  12.     #
  13.     # The location and format of the access logfile (Common Logfile Format).
  14.     # If you do not define any access logfiles within a <VirtualHost>
  15.     # container, they will be logged here.  Contrariwise, if you *do*
  16.     # define per-<VirtualHost> access logfiles, transactions will be
  17.     # logged therein and *not* in this file.
  18.     #
  19.     CustomLog "logs/access_log" combined
  20.     #
  21.     # If you prefer a logfile with access, agent, and referer information
  22.     # (Combined Logfile Format) you can use the following directive.
  23.     #
  24.     #CustomLog "logs/access_log" combined
  25. </IfModule>
  26. <IfModule alias_module>
复制代码

TOP

这样是对的
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

回复 5# admin


    终于找到问题所在了,单单修改这里还不行,还要去修改虚拟主机配置文件

TOP

这个是默认的记录文件,也是所有的
虚拟主机里的是针对站点的
看清提问三步曲及多看教程/FAQ索引(wdcp,v3,一键包,wdOS),益处多多.wdcp工具集 阿里云主机8折优惠码

TOP

返回列表