Disable nginx logs

How to disable nginx logging without critical errors?

error_log off - does not work, just creates a file name "off", really, not a joke.

error_log dev / null does not support.

OS freebsd. I need to disable logging for the subdomain.

+6
source share
2 answers

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

From wiki

Please note that error_log off does not disable logging - the log will be written to a file named "off". To disable logging, you can use:

error_log /dev/null crit;

+11
source

Set logging to stderr (redirecting to / dev / null does not work reliably, since from version 0.7.53 / var / log / nginx / error.log) is hard-coded for use until the configuration file is read ( http: //wiki.nginx.org/CoreModule#error_log ).

 error_log stderr crit; 

Using / dev / null on systems where / var / log / nginx / * does not exist will call nginx.

+1
source

Source: https://habr.com/ru/post/900520/


All Articles