Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable nginx logs

Tags:

logging

nginx

How to disable nginx logging, without crit errors?

error_log off - doesnt works, just creates filename "off", really, not joke.

error_log dev/null doesnt supports.

OS freebsd. I need disable logging for subdomain.

like image 268
alex shishkin Avatar asked Nov 01 '11 13:11

alex shishkin


2 Answers

To disable NGINX access and error log for all latest NGINX version

  http {

          access_log off;
          error_log off;

       }
like image 82
Eranga Kodikara Avatar answered Oct 11 '22 14:10

Eranga Kodikara


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". To disable logging, you may use:

error_log /dev/null crit;

like image 40
Marcelo Bittencourt Avatar answered Oct 11 '22 14:10

Marcelo Bittencourt