Linux 禁用 apache 日志记录到 access.log

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13552312/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 17:51:57  来源:igfitidea点击:

disabling apache logging to access.log

linuxapachelogging

提问by Alon_T

I've been reading about disabling the logging of the apache server, which is crucial for me as I'm running huge tests on it, and it fills the disk.

我一直在阅读有关禁用 apache 服务器的日志记录,这对我来说至关重要,因为我正在对其进行大量测试,并且它会填满磁盘。

I've tried changing http.conf and directing stuff to /dev/null, but none of it worked, as most of it was the Error logging.

我试过更改 http.conf 并将内容定向到 /dev/null,但都没有奏效,因为其中大部分是错误日志记录。

Any idea anyone?

有人知道吗?

Thanks

谢谢

采纳答案by undone

In order to disable and turn off the Apache logging, just comment out the log lines in the Apache configuration file. Read more here.

为了禁用和关闭 Apache 日志记录,只需注释掉 Apache 配置文件中的日志行。在这里阅读更多。

回答by Rum Verse

Just comment the areas where logging was set.

只需评论设置日志记录的区域。

On,

在,

httpd.conf
virtual hosts configurations (virtual.conf, domain.conf etc)

For something like

对于类似的东西

CustomLog logs/access_log common
ErrorLog logs/error_log

Just do,

做就是了,

#CustomLog logs/access_log common
#ErrorLog logs/error_log