diff --git a/system/logrotate.d/haproxy.conf b/system/logrotate.d/haproxy.conf new file mode 100644 index 0000000..9f40020 --- /dev/null +++ b/system/logrotate.d/haproxy.conf @@ -0,0 +1,12 @@ +/var/log/haproxy/haproxy.log { + daily + rotate 31 + missingok + notifempty + compress + sharedscripts + postrotate + /bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true + /bin/kill -HUP `cat /var/run/rsyslogd.pid 2> /dev/null` 2> /dev/null || true + endscript +} diff --git a/system/rsyslog.d/20-haproxy.conf b/system/rsyslog.d/20-haproxy.conf index 7b7501f..3753283 100644 --- a/system/rsyslog.d/20-haproxy.conf +++ b/system/rsyslog.d/20-haproxy.conf @@ -1,2 +1,2 @@ -if $programname == 'haproxy' then /var/log/haproxy.log +if $programname == 'haproxy' then /var/log/haproxy/haproxy.log & ~