# HAProxy logging using syslogd



## Grzegorz Wiktorowski (Sep 30, 2020)

On 11.4-RELEASE-p3 I run HAProxy 1.8.25. Following HAProxy manual I've configured in /usr/local/etc/haproxy/haproxy.cfg


```
global
    log 127.0.0.1:514 local0
......
```

to send logs to standard syslog facilities.

Then I've configured syslogd. In /usr/local/etc/syslog.d/haproxy.conf I placed:


```
!haproxy
local0.*    /var/log/haproxy.log
```

and restarted syslogd. Syslogd runs as the default with *-s* option.

Then I initiated HAProxy as `haproxy -f /usr/local/etc/haproxy/haproxy.cfg`

What makes me wonder is that there is no records in /var/log/haproxy.log. After better or worse attempts I run syslogd without *-s* option. It helps - log records start to appear in the log file.

I assume that 127.0.0.1 is local and not remote port so syslogd with *-s* should accept logging. For security reason runnig syslogd with *-s* option is recommended. On the second machine I run snmptrapd logging properly to local0 facility with default syslogd configuration ie. with *-s* option. 

Do I miss something or the issue is HAProxy specific?


----------



## T-Daemon (Sep 30, 2020)

You need to configure the syslog daemon to listen to the UDP socket:









						HAProxy not logging
					

I have been running FreeBSD with HAProxy as my reverse proxy for a while. Recently I got my ELK stack up and running, so now I want to send my HAProxy log to logstash using filebeats.  But now I noticed that my HAProxy instance is not logging to my log file, /var/log/haproxy.log...




					forums.freebsd.org


----------

