apache日志
1、vim /usr/local/apache2/conf/extra/httpd-vhosts.conf
ErrorLog "logs/test.com-error_log"       错误日志
CustomLog "logs/test.com-access_log" combined  访问日志  相对路径

Apache的common日志格式定义:
2、vim /usr/local/apache2/conf/httpd.conf
<IfModule log_config_module>
# The following directives define some format nicknames for use with
# a CustomLog directive (see below).
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
%h:客户机的IP地址
%l:客户机登陆名称
%u:认证用户
%t:访问的日期、时间
%r:客户访问的方式,访问的什么资源,什么协议
%>s 请求对应的状态码  #2开头正常,3开头被重定向,4开头客户端存在错误,5开头服务器端遇到错误
%b:传送的字节数
%{Referer}:   从哪个页面来的(比如从百度搜索到的QQ空间,那Referer就是百度)
%{User-Agent}:客户用的什么浏览器

http://11004242.blog.51cto.com/10994242/1722867