Have nginx access_log and error_log log to STDOUT and STDERR of master process

后端 未结 6 2068
一整个雨季
一整个雨季 2020-12-12 10:18

Is there a way to have the master process log to STDOUT STDERR instead of to a file?

It seems that you can only pass a filepath to the access_log directive:

6条回答
  •  生来不讨喜
    2020-12-12 11:11

    For a debug purpose:

    /usr/sbin/nginx -g "daemon off;error_log /dev/stdout debug;"
    

    For a classic purpose

    /usr/sbin/nginx -g "daemon off;error_log /dev/stdout info;"
    

    Require

    Under the server bracket on the config file

    access_log /dev/stdout;
    

提交回复
热议问题