On a CentOS Linux release 7.9.2009 (Core) I've running haproxies on two KVM virtual machines that are configured in a High Avaialability cluster with Corosync and Pacemaker, the machines are inherited from another admin (I did not install the servers hardware) and OS but have been received the system for support.
The old sysadmins seems to not care much about the system so they've left the haprxoy with Double logging one time under separate configured log in /var/log/haproxy/haproxyprod.log and each Haproxy TCP mode flown request has been double logged to /var/log/messages as well. As you can guess this shouldn't be so because we're wasting Hard drive space so to fix that I had to stop haproxy doble logging to /var/log/messages.
The logging is done under a separate local pointer local6 the /etc/haproxy/haproxyprod.cfg goes as follows:
[root@haproxy01 ~]# cat /etc/haproxy/haproxyprod.cfg
# log <address> [len
] [max level [min level]]
log 127.0.0.1 local6 debug
The logging is handled by rsyslog via the local6, so obviously to keep out the logging from /var/log/messages
The logging to the separate log file configuration in rsyslog is as follows:
It turned to be really easy to prevent haproxy get its requests log to /var/log/messages all I had to change is under /etc/rsyslogd.conf
local6.none config has to be placed for /var/log/messages the full line configuration in /etc/rsyslog.conf that stopped double logging is:
# Don't log private authentication messages!
More helpful Articles
Tags: configured, cron, disable, double, haproxy, log messages, logging, mail, messages, none, requests, separate, Stop, var
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
P.S. As upmtioneioned You can disable other stuff such as *.info for any local for example if you get some warning messages from haproxy in /var/log/messages such as:
haproxy(haproxyprod): INFO: haproxy daemon running
to disable add info.*; infront of /var/log/messages lineView CommentView Comment