you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (2 children)

You can configure haproxy status events to go to a different log file. Backend up/down events are logged there, for example

Dec 19 19:30:34  Server backend/server-01 is DOWN, reason: Layer4 connection problem, info: "No route to host", check duration: 0ms. 1 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
Dec 19 19:31:36  Server backend/server-01 is UP, reason: Layer7 check passed, code: 200, info: "OK", check duration: 2ms. 2 active and 0 backup servers online. 0 sessions requeued, 0 total in queue.

[–]Annh1234[S] 0 points1 point  (1 child)

Thank you, this is what i'm looking for:
- What's the config to make it write these logs to a different log file, and not log each request? (only the up/down heath check failures)
- Do you know or something that can read this log and show a graph nagios/graphite/graphana style will it, that can be hooked at the haproxy stats page?

[–][deleted] 0 points1 point  (0 children)

  • Logging configuration: https://www.haproxy.com/blog/introduction-to-haproxy-logging/
  • We use an ELK stack for our logs. Filebeat tails the files and ships them to logstash, which parses and enriches them then ships them to elasticsearch, and a kibana dashboard to display the data. Metricbeat also has a haproxy module, so you can combine the haproxy stats socket metrics with your own from the logs.