简体   繁体   English

禁用nginx日志

[英]Disable nginx logs

How to disable nginx logging, without crit errors? 如何禁用nginx日志记录,没有暴击错误?

error_log off - doesnt works, just creates filename "off", really, not joke. error_log off - 不起作用,只是创建文件名“off”,真的,不是开玩笑。

error_log dev/null doesnt supports. error_log dev / null不支持。

OS freebsd. 操作系统freebsd。 I need disable logging for subdomain. 我需要禁用子域的日志记录。

http://wiki.nginx.org/CoreModule#error_log http://wiki.nginx.org/CoreModule#error_log

From wiki 来自维基

Note that error_log off does not disable logging - the log will be written to a file named "off". 请注意,error_log off不会禁用日志记录 - 日志将写入名为“off”的文件。 To disable logging, you may use: 要禁用日志记录,您可以使用:

error_log /dev/null crit;

Set the logging to stderr (the redirect to /dev/null does not work reliably since from version 0.7.53 /var/log/nginx/error.log) is hardcoded to be used until the config file has been read ( http://wiki.nginx.org/CoreModule#error_log ). 将日志记录设置为stderr(重定向到/ dev / null不可靠,因为从版本0.7.53 /var/log/nginx/error.log开始)是硬编码的,直到读取配置文件为止( http:/ /wiki.nginx.org/CoreModule#error_log )。

error_log stderr crit;

Using /dev/null on systems where /var/log/nginx/* doesn't exist will cause nginx to quit. 在/ var / log / nginx / *不存在的系统上使用/ dev / null将导致nginx退出。

To disable NGINX access and error log for all latest NGINX version 禁用所有最新NGINX版本的NGINX访问和错误日​​志

  http {

          access_log off;
          error_log off;

       }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM