If you look at the top of
/etc/haproxy/haproxy.cfg
, you will see something like:Let’s edit
/etc/rsyslog.conf
and uncomment these lines:/etc/rsyslog.d/haproxy.conf
file containing:/etc/haproxy/haproxy.cfg
, you will see something like:
1
2
3
|
global
log 127.0.0.1 local2
[...]
|
/etc/rsyslog.conf
and uncomment these lines:
1
2
|
$ModLoad imudp
$UDPServerRun 514
|
1
|
$UDPServerAddress 127.0.0.1
|
/etc/rsyslog.d/haproxy.conf
file containing:
1
|
local2.* /var/log/haproxy.log
|
1
2
|
local2.=info /var/log/haproxy-info.log
local2.notice /var/log/haproxy-allbutinfo.log
|
1
2
3
4
5
6
7
|
# service rsyslog restart
Shutting down system logger: [ OK ]
Starting system logger: [ OK ]
# ls -l /var/log | grep haproxy
-rw-------. 1 root root 131 3 oct. 10:43 haproxy-allbutinfo.log
-rw-------. 1 root root 106 3 oct. 10:42 haproxy-info.log
|
Không có nhận xét nào:
Đăng nhận xét