gpt4 book ai didi

logging - HAProxy 只会记录启动消息

转载 作者:可可西里 更新时间:2023-11-01 02:53:47 24 4
gpt4 key购买 nike

我试图让 HAProxy 记录我一直在做的 tcp 流量,但没有成功。这是我的配置文件:

/etc/haproxy/haproxy.cfg

global
log /var/lib/haproxy/dev/log local0 debug
chroot /var/lib/haproxy
maxconn 2000
user haproxy
group haproxy

defaults
log /var/lib/haproxy/dev/log local4 debug
mode tcp
option tcplog
option dontlognull
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000

listen sco 0.0.0.0:80
log /var/lib/haproxy/dev/log local4 debug
mode tcp
stats enable
stats uri /haproxy?stats
balance roundrobin

cookie SERVERID insert indirect nocache
server test11 172.21.0.3:8888 check cookie test11
server test12 172.21.0.2:8888 check cookie test12

/etc/rsyslog.d/49-haproxy.conf

$ModLoad imudp
$UDPServerAddress 127.0.0.1
$UDPServerRun 514

local0.* -/var/log/haproxy/haproxy_0.log
local4.* -/var/log/haproxy/haproxy_4.log
if ($programname == 'haproxy') then -/var/log/haproxy/haproxy.log
& ~

我得到的输出只是代理启动行。

/var/log/haproxy/haproxy.log

Mar 31 18:23:19 74f09d6f9f70 haproxy[27]: Proxy sco started.

/var/log/haproxy/haproxy_4.log

Mar 31 18:23:19 74f09d6f9f70 haproxy[27]: Proxy sco started.

我产生了一些流量。 HAProxy 正确重定向它但不会记录任何内容。我想知道发生了什么。

最佳答案

您只能记录到系统日志服务器而不是文件。

查看文档:http://cbonte.github.io/haproxy-dconv/1.7/configuration.html#8

关于logging - HAProxy 只会记录启动消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43147865/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com