Files
openstack-ansible-haproxy_s…/files/haproxy-logging.cfg
Corey Wright 1e0aa6bf47 Allow rsyslog to log HAProxy locally
* Install haproxy-logging.cfg numerically before Ubuntu's
  /etc/rsyslog.d/49-haproxy.conf so its logging directives see HAProxy
  logs before they are discarded by 49-haproxy.conf.
* Set owner of /var/log/haproxy to rsyslog's `syslog` user so rsyslog
  can write to it on Ubuntu.
* Limit HAProxy-related rsyslog processing to HAProxy log messages
  instead of any/all log messages with the local0 or local1 facility
  and assuming HAProxy is the only application using those facilities.

Change-Id: Ic259abc281619ba5ee8f020ac68373858a06e94d
Closes-Bug: #1783886
2018-09-23 00:58:47 -05:00

16 lines
688 B
INI

$ModLoad imudp
$UDPServerRun 514
$template Haproxy,"%msg%\n"
if $programname startswith 'haproxy' then {
# Connections are logged at level "info".
# See https://www.haproxy.org/download/1.6/doc/configuration.txt.
local0.=info -/var/log/haproxy/haproxy.log
# Level "notice" will be used to indicate a server going up,
# "warning" will be used for termination signals and definitive service
# termination, and "alert" will be used for when a server goes down.
# See https://www.haproxy.org/download/1.6/doc/configuration.txt.
local1.notice -/var/log/haproxy/haproxy-status.log
# Discard HAProxy messages to prevent further processing/logging.
local0.*;local1.* ~
}