As nginx 1.7+ supports syslog
, I tried to aggregate all nginx nodes logs onto a remote rsyslog server. I set the nginx.conf
with
error_log syslog:server=[REMOTE_HOST]:514,tag=nginx;
access_log syslog:server=[REMOTE_HOST]:514,tag=nginx;
And on remote rsyslog server, i set a config file with
local7.debug /var/log/nginx/access.log; RemoteFormat
local7.debug /var/log/nginx/error.log; RemoteFormat
But still cannot get log, how to aggregate all nginx access.log
and error.log
to separate files access.log
and error.log
on remote rsyslog server? Thank you in advance.