6

By default, my nginx server is plotting logs to stdout and stderr.

I want to forward logs to my syslog server, and I'm doing so successfully, from 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;
  ...
}

How can I config my server to also plot the logs to stdout and stderr?

Mugen
  • 8,301
  • 10
  • 62
  • 140

1 Answers1

6

Just have multiple error_log and access_log entries inside your block

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;

Should do the trick

Andrea Golin
  • 3,259
  • 1
  • 17
  • 23