1) haproxy configuration file
log 127.0.0.1 local1 notice
#此处使用系统的rsyslog来处理日志
2) rsyslog configuration "/etc/rsyslog.conf"
local0.*/var/log/haproxy.log
Uncomment the following:
# $ModLoad imudp = = "$ModLoad imudp
# $UDPServerRun 514 = = " $UDPServerRun 514
3) Verifying Services Files
grep 514/etc/services
---> Display: "syslog 514/udp" is OK!!!
---> If it does not exist,
Then add it manually in/etc/default/rsyslog:
rsyslogd_options= "-r-c 5"
Restart Rsyslog Service
4) Configure Logrotate
/home/haproxy/log/*.log { Daily Missingok Dateext Rotate 7 Compress Delaycompress Create 0640 Haproxy ADM Notifempty Sharedscripts Postrotate Reload Rsyslog >/dev/null 2>&1 | | True Endscript }
|
This article is from the "learning is not transcribed" blog, please be sure to keep this source http://istyle.blog.51cto.com/6152438/1785005
Ubuntu under Haproxy log processing