haproxy开启日志

haproxy开启日志
vi /etc/haproxy/haproxy.cfg
#添加配置
global
    log         127.0.0.1 local2 info
defaults
    mode                    http
    log                     global  #开启日志功能
systemctl restart haproxy.service

 
  
#修改日志
vi /etc/rsyslog.conf 
#去掉注释
# Provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
#添加日志路径
local2.*    /var/log/haproxy.log
systemctl restart rsyslog.service  

#查看日志
[root@manager log]# tail -100f /var/log/harpox.log
May 9 17:39:26 localhost haproxy[32484]: Connect from 100.98.100.186:60128 to 100.98.100.186:5000 (main/HTTP)

  

posted @ 2023-05-10 10:31  苍茫宇宙  阅读(459)  评论(0编辑  收藏  举报