1

What is the difference between 49-haproxy.conf and the haproxy.conf files?

Now I have no idea if this is specific to Ubuntu or if this is in general. The documentation on HAProxy is astoundingly bad. I'm guessing it has something to do with rsyslogd?

The files are normally kept in the /etc/rsyslog.d/ directory.

1 Answers1

1

From a blog post:

Thanks for this! It saved me a lot of time.

One thing I'd suggest changing -- in Ubuntu Oneiric (and I suspect in older versions), the rsyslogd config you specify will leave haproxy logging in both /var/log/haproxy_1.log and in /var/log/syslog. This is because rsyslogd writes each message out using every rule in its configuration that matches unless specifically told not to.

The "& ~" at the end of your file /etc/rsyslog.d/haproxy.conf means "once you've written something using the rule above, don't process any more rules for this message". But it won't stop messages from being written out by rules that were specified before the one in /etc/rsyslog.d/haproxy.conf

Now, the default Oneiric config has a file called /etc/rsyslog.d/50-default.conf which does the default configuration, including a catch-all "write everything to syslog" rule. And because files from /etc/rsyslog.d/ are included in alphabetical order, the rules in 50-default.conf are applied before the ones in haproxy.conf -- so you get your haproxy stuff dumped into both files.

The solution is obviously to call your own rsyslogd config file something like /etc/rsyslog.d/49-haproxy.conf