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

后端 未结 6 2031
一整个雨季
一整个雨季 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:08

    If the question is docker related... the official nginx docker images do this by making softlinks towards stdout/stderr

    RUN ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log

    REF: https://microbadger.com/images/nginx

提交回复
热议问题