开启日志记录:
[root@sherry ~]# vim /etc/rsyslog.conf
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
# Provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
local2.* /var/log/haproxy.log
[root@sherry ~]# /etc/init.d/rsyslog restart
测试结果: