I'm trying to output the logs of several Nginx servers in FreeBSD jails to the jails' host. I'm using FreeBSD 10 syslog and Nginx 1.7.10.
In Nginx (in this case the hostname is web
) I have set:
access_log syslog:server=127.0.0.1:514 syslog;
http://nginx.org/en/docs/syslog.html
In the host's syslog.conf
:
+web
*.=info /var/log/jails/web/nginx-access.log
In the host's rc.conf
:
syslogd_flags="-a 10.0.0.1/24:* -v -v -C"
the output in my file is
Mar 31 19:45:50 <local7.info> web web nginx: […]
My problem is that I would like to specify tags in Nginx to differentiate several servers.
According to the FreeBSD documentation of syslog.conf
If a received message matches the specified facility and is of the speci- fied level (or a higher level), and the first word in the message after the date matches the program, the action specified in the action field will be taken.
https://www.freebsd.org/cgi/man.cgi?query=syslog.conf&sektion=5
But my output is hostname
hostname
tag / program
.
So trying to specify the program / a tag in syslog.conf
(like !nginx
) doesn't work.
Is there any way to catch tags on FreeBSD's syslog? Is this a bug in Nginx 1.7.10?