Haproxy开启日志

------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.cfg
修改成
global
log 127.0.0.1 local2
------Centos6.x------

service haproxy restart
service rsyslog restart

------Centos6.x------

 

 

 

------CentOS7.x------
vi /etc/haproxy/haproxy.cfg
log 127.0.0.1 local2
------
vi /etc/rsyslog.conf
$ModLoad imudp
$UDPServerRun 514

#### RULES ####
local2.* /var/log/haproxy.log
------
systemctl restart rsyslog
systemctl restart haproxy
------CentOS7.x------

posted @ 2019-08-12 18:11  qinliang  阅读(440)  评论(0编辑  收藏  举报