------Centos6.x------
vim /etc/rsyslog.conf# Provides UDP syslog reception
$ModLoad imudp$UDPServerRun 514#### RULES ####
local0.* /var/log/haproxy.log------Centos6.x------
vim /etc/sysconfig/rsyslog修改成# Options for rsyslogd# Syslogd options are deprecated since rsyslog v3.# If you want to use them, switch to compatibility mode 2 by "-c 2"# See rsyslogd(8) for more details# SYSLOGD_OPTIONS="-c 5"SYSLOGD_OPTIONS="-r -m 0 -c 2"------Centos6.x------
vim /etc/haproxy/haproxy修改成global log 127.0.0.1 local2------Centos6.x------service haproxy restart
service rsyslog restart------Centos6.x------
------CentOS7.x------
vi /etc/haproxy/haproxy.cfglog 127.0.0.1 local2------vi /etc/rsyslog.conf$ModLoad imudp$UDPServerRun 514#### RULES ####
local2.* /var/log/haproxy.log------systemctl restart rsyslogsystemctl restart haproxy------CentOS7.x------