8. Logging

  1. One of HAProxy's strong points certainly lies is its precise logs. It probably
  2. provides the finest level of information available for such a product, which is
  3. very important for troubleshooting complex environments. Standard information
  4. provided in logs include client ports, TCP/HTTP state timers, precise session
  5. state at termination and precise termination cause, information about decisions
  6. to direct traffic to a server, and of course the ability to capture arbitrary
  7. headers.
  8.  
  9. In order to improve administrators reactivity, it offers a great transparency
  10. about encountered problems, both internal and external, and it is possible to
  11. send logs to different sources at the same time with different level filters :
  12.  
  13. - global process-level logs (system errors, start/stop, etc..)
  14. - per-instance system and internal errors (lack of resource, bugs, ...)
  15. - per-instance external troubles (servers up/down, max connections)
  16. - per-instance activity (client connections), either at the establishment or
  17. at the termination.
  18. - per-request control of log-level, e.g.
  19. http-request set-log-level silent if sensitive_request
  20.  
  21. The ability to distribute different levels of logs to different log servers
  22. allow several production teams to interact and to fix their problems as soon
  23. as possible. For example, the system team might monitor system-wide errors,
  24. while the application team might be monitoring the up/down for their servers in
  25. real time, and the security team might analyze the activity logs with one hour
  26. delay.