haproxy打印日志配置

<pre name="code" class="sql"><pre name="code" class="sql">jrhppt01:/var/log/haproxy# lsof haproxy.log
COMMAND   PID USER   FD   TYPE DEVICE   SIZE/OFF   NODE NAME
rsyslogd 2935 root    6w   REG  202,1 4884441877 786468 haproxy.log


需要配置rsyslog

[haproxy@haproxy haproxy]$ yum install  sysklogd syslog-n rsyslog

vi /etc/rsyslog.conf

添加下面配置:

  # Provides UDP syslog reception                                                                            
  $ModLoad imudp                                                                                                        

          
  $UDPServerRun 514                                                                                                     

      
  $UDPServerAddress 127.0.0.1  

*.info;mail.none;authpriv.none;cron.none;local3.none                /var/log/messages


local3.*    /var/log/haproxy/haproxy.log

#keepalived -S 0
local0.*	/var/log/keepalived/keepalived.log


启动rsyslog

v-lhb-prx01:/etc# /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
v-lhb-prx01:/etc#  netstat -nap | grep 514
udp        0      0 0.0.0.0:514                 0.0.0.0:*                               20105/rsyslogd      
udp        0      0 :::514                      :::*                                    20105/rsyslogd   

haproxy:/etc# netstat -nap | grep 514
udp        0      0 0.0.0.0:514                 0.0.0.0:*                               8851/rsyslogd       
udp        0      0 :::514                      :::*                                    8851/rsyslogd  


 
 
 

你可能感兴趣的:(haproxy打印日志配置)