No Logs (syslog)

Hello,

I’ve added the following config into haproxy.cfg, but no logs seem to be getting sent to the syslog server. I’ve looked through the documentation and previous topics, but not sure what I’m missing.

Version: 1.8.8 2018/04/19

global
   #log /dev/log local0
   #log /dev/log local1 notice
   log x.x.x.x:5140 syslog debug
   
defaults
   log global
   option httplog
   option tcplog
   option dontlognull

Thanks for any help.

The default syslog port is 514, not 5140. Maybe that’s it?

The syslog server is listening on 5140 UDP, non default port. Not that easy :slight_smile:

Does the config look ok? I assume at debug level I should be seeing connection logs?

Yes, config looks ok. You should also see some messages about haproxy and its backends beeing started/stopped while reloading or restarting haproxy.

If you don’t see anything at all, there may be a connectivity issue between haproxy and your syslog server.

Your best bet at this point is tcpdump it.

No idea what happened, but it started working just as I went to tcpdump it. I guess it also doesn’t make sense to have both ‘option httplog’ and ‘option tcplog’ in the default section, since one would take precedence?

Thanks for your help.

httplog should be used for http mode, tcp mode for tcp mode. Not sure what the behavior is when they are competing against each other or with incompatible modes. Just configure it correctly.