[Pkg-haproxy-maintainers] Syslog via /dev/log

Apollon Oikonomopoulos apoikos at gmail.com
Fri Apr 26 10:12:36 UTC 2013

Hi Prach,

On 12:17 Fri 26 Apr     , Prach Pongpanich wrote:
>  IMO, we should provide /etc/rsyslog.d/??-haproxy.conf and
> /etc/logrotate.d/haproxy
> # haproxy.cfg
> log  local0
> #/etc/rsyslog.d/??-haproxy.conf
> $ModLoad imudp
> $UDPServerAddress
> $UDPServerRun 514

I think this is actually too intrusive. Enabling UDP logging is a 
system-wide setting and it would be best to have this done in the 
rsyslog package and not HAProxy. Adding one more listening socket on the 
other hand, is something that is being done already (e.g. postfix).

> local0.* -/var/log/haproxy.log
> & ~

local0 is not guaranteed to contain only HAProxy messages. This has
the following side-effects:
 a. /var/log/haproxy.log may contain non-haproxy logs
 b. 3rd application logs using local0 will never end-up in 
    /var/log/syslog if we drop local0.*

Using the property replacer to match the process name would be better:

if $programname startswith 'haproxy' then /var/log/haproxy.log

> # /etc/logrotate.d/haproxy
> /var/log/haproxy.log {
>     daily
>     rotate 52
>     missingok
>     notifempty
>     compress
>     delaycompress
>     sharedscripts
>     postrotate
>         invoke-rc.d rsyslog rotate >/dev/null 2>&1 || true
>     endscript
> }

Agreed, had it on my list as well. No need for sharedscripts though, 
we're only rotating one logfile.

Any comments?


More information about the Pkg-haproxy-maintainers mailing list