Skip to content

HAProxy httplog format

mfournier edited this page Mar 4, 2011 · 1 revision

As of version 1.10.0, request-log-analyzer supports HAProxy’s httplog format. In most cases, this file format will be auto-detected. Use --format haproxy to instruct r-l-a to parse a file as an HAProxy *httplog" if the auto-detect mechanism fails.

Configuring HAProxy logging

HAProxy is capable of generating several different log formats. Currently, r-l-a only knows about the httplog format. It should be noted that HAProxy is not able to write logfiles itself. Instead, it sends its log messages to a syslog instance, meaning that you’ll also have to setup a syslog server somewhere.

Here is the minimal configuration directives you should have in your haproxy.cfg to have anything useful to feed to r-l-a:

global
  log        127.0.0.1:514 local0
defaults
  log        global
  option     httplog

It should also be noted that by default syslog truncates log messages to 1024 bytes. So you will probably want to instruct your syslog server to accept longer messages. With rsyslogd, it will look like: $MaxMessageSize 64k. With syslog-ng, you’ll use something like: source my_source { udp(log_msg_size(65536)); };.

For more details about configuring logging in HAProxy, please read http://code.google.com/p/haproxy-docs/wiki/Logging.