Haproxy logs are misconfigured

If i understand it correctly, the Leap Platform wants haproxy to log to @/var/log/haproxy.log@ through rsyslog.

That configuration seems to be broken, because:

  • haproxy is configured to log to @127.0.0.1@ (port 514 by default) in @/etc/haproxy/haproxy.cfg@.
  • rsyslog doesn't seem to be configured to listen for messages in localhost (i.e. no @$UDPServerRun@ directive in @/etc/rsyslog.*@.
  • rsyslog is configured to create a file socket to haproxy at @/var/lib/haproxy/dev/log@ (in @/etc/rsyslog.d/49-haproxy.conf@).
  • haproxy would never see the file socket created by rsyslog because it runs in a chroot environment at @/usr/share/haproxy@.

The solution I came up with is the following:

  • change haproxy configuration to log to @/log@ which is relative to the chroot environment at @/usr/share/haproxy@.
  • change the file socket created by rsyslog to @/usr/share/haproxy/log@.

(from redmine: created on 2017-01-06)