Collecting log data from HAProxy

Apparently what I did with having two configs for haproxy logging to rsyslog was causing some sort of loop. So I got rid of the /etc/rsyslog/rsyslog.d/10-graylog_haproxy.conf and instead added the line “.@192.168.30.6:5143” into the default / already existing 49-haproxy.conf in same directory:

Create an additional socket in haproxy’s chroot in order to allow logging via

/dev/log to chroot’ed HAProxy processes

$AddUnixListenSocket /var/lib/haproxy/dev/log

Send HAProxy messages to a dedicated logfile

:programname, startswith, “haproxy” {
/var/log/haproxy.log
.@192.168.30.6:5143
stop
}

In doing that, I now have HAProxy logs coming into Graylog and no crazyness happening in the haproxy.log file. Case closed :slight_smile:

1 Like