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

后端 未结 6 2053
一整个雨季
一整个雨季 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 10:54

    In docker image of PHP-FPM, i've see such approach:

    # cat /usr/local/etc/php-fpm.d/docker.conf
    [global]
    error_log = /proc/self/fd/2
    
    [www]
    ; if we send this to /proc/self/fd/1, it never appears
    access.log = /proc/self/fd/2
    

提交回复
热议问题