How to configure RHEL7
Problem: The haproxy config (
/etc/haproxy/haproxy.cfg) reports how to enable logs; however, this seems to be syslogd specific which is not what is running in RHEL7
Solution: enable logging via rsyslog configs:
/etc/rsyslog.conf to include:
# Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514 # Provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 514
*note: maybe only UDP or maybe only TCP is needed.
SYSLOGD_OPTIONS="-m 0 -r" local2.* /var/log/haproxy.log
*note: this could just as easily be
/etc/rsyslog.d/haproxy.conf, i chose the prior only because it pre-existed.
*note: local2 is the default in haproxy, but this could be changed if desired.
-r is required, the
-m 0 is not, but meant to reduce junk. If it is looking up DNS and you don’t want, then add
sudo systemctl restart rsyslog and
tail -f /var/log/haproxy.log to see the records.
As always, good luck!
Written with StackEdit.