I have configured rsyslog (CentOS 6.3) adding the -c 0 -r options and the line local2.* /var/log/haproxy.log and restarted rsyslog but all that happens is an haproxy.log gets created. It is never written to. Not quite sure how to troubleshoot this. Below is my haproxy.cfg file. Nothing else is configured to use local2 according to grepping for it in rsyslog.conf. My haproxy config is basically the default, just trying to get logging working first.
I believe haproxy only have syslog logging via UDP. What is your log config line in haproxy.cfg?
If so, you'll need to enable the UDP server modules in the rsyslog configuration by uncommenting:
Tip: I run the following command on all my haproxy servers: