Haproxy, log to syslog does not work

Hello,

just install haproxy on IPFire 2.29 (x86_64) - Core-Update 198. The standard configuration in /etc/haproxy/haproxy.cfg is:

global
    # to have these messages end up in /var/log/haproxy.log you will
    # need to:
    #
    # 1) configure syslog to accept network log events.  This is done
    #    by adding the '-r' option to the SYSLOGD_OPTIONS in
    #    /etc/sysconfig/syslog
    #
    # 2) configure local2 events to go to the /var/log/haproxy.log
    #   file. A line like the following can be added to
    #   /etc/sysconfig/syslog
    #
    #    local2.*                       /var/log/haproxy.log
    #
    log         127.0.0.1 local2

But I have only a /etc/syslog.conf, there is a line:

 # HAProxy
local1.*                                          -/var/log/haproxy

But the /var/log/haproxy.log file is empty.

The next strange thing is, there is no button in the webinterface from IPfire, but I read, there should be one?

Any ideas?

Hello Bernd,

the snippet in haproxy.conf to match the syslog configuration should be:

        # Logging
        log 127.0.0.1 local1

This works well for me.

A button for what?

Hi Michael,

In the haproxy.cfg that is provided with haproxy in IPFire has local2 in place of local1

Should that be changed in the default config file that is provided?

The example configuration is probably not the best as it is coming from upstream, but I think it would be helpful to run a little sed command over it and replace the log facility. I agree.

1 Like

Don’t need to use sed as the file is in our build config directory.

I will submit a patch to change that log facility.

Oh, sorry, a button / Webinterface for haproxy. But I search google and found, there is no webinterface for haproxy in IPFire.