The error_log and access_log directives support logging to syslog. The following parameters configure logging to syslog:
server=
address
unix:
” prefix. If port is not specified, the UDP port 514 is used. If a domain name resolves to several IP addresses, the first resolved address is used. facility=
string
kern
”, “user
”, “mail
”, “daemon
”, “auth
”, “intern
”, “lpr
”, “news
”, “uucp
”, “clock
”, “authpriv
”, “ftp
”, “ntp
”, “audit
”, “alert
”, “cron
”, “local0
”..“local7
”. Default is “local7
”. severity=
string
info
”. Severity of error messages is determined by nginx, thus the parameter is ignored in the error_log
directive.
tag=
string
nginx
”. nohostname
Example syslog configuration:
error_log syslog:server=192.168.1.1 debug; access_log syslog:server=unix:/var/log/nginx.sock,nohostname; access_log syslog:server=[2001:db8::1]:12345,facility=local7,tag=nginx,severity=info combined;
Logging to syslog is available since version 1.7.1. As part of our commercial subscription logging to syslog is available since version 1.5.3.
© 2002-2020 Igor Sysoev
© 2011-2020 Nginx, Inc.
Licensed under the BSD License.
https://nginx.org/en/docs/syslog.html