向syslog和stdout/stderr发送nginx日志

向syslog和stdout/stderr发送nginx日志,nginx,stdout,stderr,nginx-config,Nginx,Stdout,Stderr,Nginx Config,默认情况下,mynginx服务器正在将日志打印到stdout和stderr 我想从nginx.conf将日志转发到我的syslog服务器,并且我正在成功地这样做: server { ... error_log syslog:server=localhost:5447,facility=local7,tag=nginx_client,severity=error; access_log syslog:server=localhost:5447,facility=local7,tag=n

默认情况下,my
nginx
服务器正在将日志打印到
stdout
stderr

我想从
nginx.conf
将日志转发到我的syslog服务器,并且我正在成功地这样做:

server {
  ...
  error_log syslog:server=localhost:5447,facility=local7,tag=nginx_client,severity=error;
  access_log syslog:server=localhost:5447,facility=local7,tag=nginx_client,severity=info;
  ...
}

如何将我的服务器配置为将日志打印到
stdout
stderr

只需在块中有多个错误日志和访问日志条目即可

error_log syslog:server=localhost:5447,facility=local7,tag=nginx_client,severity=error;

access_log syslog:server=localhost:5447,facility=local7,tag=nginx_client,severity=info;

error_log stderr;
access_log /dev/stdout;
我们应该这样做