记录 haproxy 检查结果/问题

vir*_*tor 5 monitoring logging haproxy

如何启用 haproxy 检查结果(或仅失败)的日志记录?我看到一些邮件列表帖子表明这是可能的

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.
Run Code Online (Sandbox Code Playgroud)

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

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
Run Code Online (Sandbox Code Playgroud)

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

vir*_*tor 1

找到原因了 我使用的 haproxy 版本根本没有记录失败消息。