如何关闭 Apache 的web日志记录(unix 系统)

来源:百度知道 编辑:UC知道 时间:2024/06/01 07:17:06
#EnableSendfile off

#
# ErrorLog: The location of the error log file.
# If you do not specify an ErrorLog directive within a <VirtualHost>
# container, error messages relating to that virtual host will be
# logged here. If you *do* define an error logfile for a <VirtualHost>
# container, that host's errors will be logged there and not here.
#
ErrorLog logs/error_log

#
# LogLevel: Control the number of messages logged to the error_log.
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
#
LogLevel warn

#
# 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"

如下修改,禁用了错误日志和访问日志:

<VirtualHost *:80>
DocumentRoot /home/xxxxxxx
ServerName www.xxxxxxx.com.cn
ServerAlias xxxxxxx.com.cn
#ErrorLog logs/xxxxxxx.com.cn.error_log
#CustomLog logs/xxxxxxx.com.cn.access_log common
DirectoryIndex index.html index.htm default.html default.htm
ErrorDocument 404 /404.htm
</VirtualHost>

如下修改,只是禁用了访问日志:

<VirtualHost *:80>
DocumentRoot /home/xxxxxxx
ServerName www.xxxxxxx.com.cn
ServerAlias xxxxxxx.com.cn
ErrorLog logs/xxxxxxx.com.cn.error_log
#CustomLog logs/xxxxxxx.com.cn.access_log common
DirectoryIndex index.html index.htm default.html default.htm
ErrorDocument 404 /404.htm
</VirtualHost>

如下修改,只是禁用了错误日志:

<VirtualHost *:80&g