logginghaproxy检查结果/问题

如何启用haproxy检查结果的日志logging(或仅失败)? 我已经看到一些邮件列表post暗示这是可能的 :

Server LDAPSFarm/LDAPS1 is DOWN, reason: Socket error, check duration: 277ms. 1 active and 0 backup servers online. 0 sessions requeued, 0 total in queue. 

但是我没有得到相同的结果。 我的configuration更多的是这样的:

 global log 127.0.0.1 local0 user haproxy group haproxy spread-checks 5 defaults log global mode http option httplog option dontlognull retries 3 redispatch maxconn 2000 stats enable stats hide-version option allbackups listen XXX YYY mode tcp balance roundrobin option httpchk / server XXX-1 ZZZ1 check port 8080 inter 2s rise 15 slowstart 10s server XXX-2 ZZZ2 check port 8080 inter 2s rise 15 slowstart 10s 

如果我启用统计信息页面并查看它,我可以看到有时服务器线路变成黄色/红色,这表明监视失败,但目前我没有在日志文件中看到任何相关的信息。 我如何获得这些信息?

您的系统日志服务器实际上是否正在127.0.0.1上进行侦听,并且被configuration为在某处logging所有local0。*消息?

find一个理由。 我使用的haproxy版本根本没有logging失败消息。

我认为这是没有关于haproxy版本,您可能需要添加一行

 "option log-health-checks" 

在haproxy的configuration文件中。 如下所示

 defaults log global mode tcp option tcplog option log-health-checks option dontlognull option dontlog-normal option redispatch