将Nginx日志发送到syslog和stdout / stderr

时间:2018-10-25 08:06:57

标签: nginx stdout stderr nginx-config

默认情况下,我的nginx服务器正在将日志绘制到stdoutstderr

现在,我想将日志从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;
  ...
}

如何配置服务器以还要将日志绘制到stdoutstderr

我的nginx在

上运行

1 个答案:

答案 0 :(得分:2)

您的块中仅包含多个error_log和access_log条目

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;

应该做到这一点

相关问题