Config file for haproxy logs

Currently I have my haproxy traffic logs going into gray log but my system logs for that server are not.
here is my .conf file. Where have a I gone wrong? If i move the system log line to the top then that works but haproxy traffic logs stop then and vice vera.

$template GRAYLOGRFC5424,"<%PRI%>%PROTOCOL-VERSION% %TIMESTAMP:::date-rfc3339% %HOSTNAME% %APP-NAME% %PROCID% %MSGID% %STRUCTURED-DATA% %msg%\n"
$AddUnixListenSocket /var/lib/haproxy/dev/log

Send HAProxy messages to a dedicated logfile
if $programname startswith ‘haproxy’ then /var/log/haproxy.log
if $syslogtag contains ‘haproxy’ then @@192.168.14.148:10514;GRAYLOGRFC5424

. @@192.168.14.148:10514;RSYSLOG_SyslogProtocol23Format

I think i worked that out by having 2 config files one for syslog and other for the haproxy part then it seems to log both.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.