Disable nginx logs

后端 未结 3 1374
鱼传尺愫
鱼传尺愫 2021-02-14 11:33

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 suppo

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-14 12:03

    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).

    error_log stderr crit;
    

    Using /dev/null on systems where /var/log/nginx/* doesn't exist will cause nginx to quit.

提交回复
热议问题