【问题标题】:Send nginx logs to both syslog and stdout/stderr将 nginx 日志发送到 syslog 和 stdout/stderr
【发布时间】:2019-03-29 18:34:46
【问题描述】:

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

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

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 stdout stderr nginx-config


    【解决方案1】:

    在你的块中只有多个 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;
    

    应该做的伎俩

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-10-02
      • 2015-12-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-07
      • 1970-01-01
      相关资源
      最近更新 更多