Syslog messages being double-tagged localhost AND hostname



I’m getting strange behaviour with haproxy-1.5.14-3.el7.x86_64 on CentOS 7…

I’ve set haproxy to log to syslog with the following lines in the global section of my haproxy.cfg:

log local2

This works fine on an Amazon Linux 6 server with haproxy-1.5.2-2.5.amzn1.x86_64 and I get lines like the following in /var/adm/messages:

Oct 12 16:10:13 haproxy[31181]:,[12/Oct/2016:16:10:12.848],haproxy-fe-8002,haproxy-be-v4-80/V41,602/0/1/13/616,200,5253,-,-,–VN,19/19/0/1/0,0/0,{|66|Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 |http://amp.myco},“POST /j_security_check HTTP/1.1”,

…all good!

But using the identical config (haproxy.cfg same checksum) on CentOS 7 the messages are logged to /var/adm/messages with both “localhost” and hostname, like:

Oct 12 15:55:59 localhost server2.myco. haproxy[17886]:,[12/Oct/2016:15:55:10.743],haproxy-fe-8002,haproxy-be-v5-80/V51a,48567/0/1/2/48570,200,2446,-,-,–NN,12/12/0/0/0,0/0,{||Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like |},“GET /ecc/ HTTP/1.1”,

This one has me stumped - is there someting I’m missing?

thanks for looking!


I suggest you compare the actual syslog message:

tcpdump -ps0 -i lo port syslog