Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

how can I enable logging of haproxy check results (or failures only)? I've seen some mailing list posts suggesting this is possible:

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.

but I don't get the same results. My config is more of less this:

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

If I enable statistics page and look at it, I can see that sometimes server lines go yellow/red which suggests monitoring failures, but currently I don't see anything related in the log files. How can I get this information?

share|improve this question

3 Answers 3

i think it's nothing about haproxy version, you may need add a line with

"option  log-health-checks" 

in configuration file of haproxy. like below

defaults
        log     global
        mode    tcp
        option  tcplog
        option  log-health-checks
        option  dontlognull
        option  dontlog-normal
        option  redispatch
share|improve this answer
up vote 0 down vote accepted

Found out a reason. The version of haproxy I used simply didn't log the failure messages.

share|improve this answer

Is your syslog server actually listening on 127.0.0.1 and is configured to log all local0.* messages somewhere?

share|improve this answer
    
Yes - I get the general log lines about starting up, etc. but no information about services going down/up –  viraptor Aug 15 '10 at 13:51
1  
What version of haproxy do you run? –  sendmoreinfo Aug 15 '10 at 14:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.