Apache不指定记录文件日志
编辑虚拟主机配置文件在Errorlog和Customlog中间加入不指定记录文件日志的格式,
如下所示:
ErrorLog "lam.com-error_log"
SetEnvIf Resquest_URI ".*\.gif$" image-request
SetEnvIf Resquest_URI ".*\.jpg$" image-request
SetEnvIf Resquest_URI ".*\.png$" image-request
SetEnvIf Resquest_URI ".*\.bmp$" image-request
SetEnvIf Resquest_URI ".*\.swf$" image-request
SetEnvIf Resquest_URI ".*\.js$" image-request
SetEnvIf Resquest_URI ".*\.css$" image-request
CustomLog "|/usr/local/apache2/bin/rotatelogs -l /usr/local/apache2/logs/lam.com-access_%Y%m%d_log 86400" combined env=!image-request
红色部分即为:Apache不指定记录文件日志,$符号前面为不指定文件的格式
# apachectl -t
Syntax OK
# apachectl restart
生效
页:
[1]