Apache日志文件
时间:2010-03-18 来源:aprilus
摘录自:日志文件 - Apache 2.2 中文版参考手册
错误日志(Error Log)
Ubuntu下的默认路径:/var/log/apache2/error.log*相关指令
* ErrorLog
* LogLevel
持续监视错误日志:
tail -f error_log |
访问日志(Access Log)
Ubuntu下的默认路径:/var/log/apache2/access.log*相关模块
* mod_log_config
* mod_setenvif
相关指令
* CustomLog
* LogFormat
* SetEnvIf
通用日志格式(Common Log Format):
LogFormat "%h %l %u %t \"%r\" %>s %b" common |
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined |
LogFormat "%h %l %u %t \"%r\" %>s %b" common |
# 不记录本机发出的请求 |
# 将使用英语的请求记录到一个日志,而记录非英语的请求到另一个日志 |
日志滚动
mv access_log access_log.old |
管道日志
CustomLog "|/usr/local/apache/bin/rotatelogs /var/log/access_log 86400" common |
虚拟主机
LogFormat "%v %l %u %t \"%r\" %>s %b" comonvhost |
其他日志文件
相关模块* mod_logio
* mod_log_forensic
* mod_cgi
* mod_rewrite
相关指令
* LogFormat
* ForensicLog
* PidFile
* RewriteLog
* RewriteLogLevel
* ScriptLog
* ScriptLogBuffer
* ScriptLogLength