Custom http Logs Haproxy

haproxy

Hi I am trying to configure Custom logging for my Haproxy version 1.4.22. I am using option httplog and option asap when I add

  log format %hr\ %r\ %st\ %B\ %Tr

in listen section I get below error

  service haproxy restart
  [ALERT] 288/112904 (14449) : parsing [/etc/haproxy/haproxy.cfg:46] : unknown log    facility '%hr %r %st %B %Tr'

Errors found in configuration file, check it with 'haproxy check'.

I would like to know where should I put directive log format in my haproxy config file.
Any help will be appreciated .

Best Answer

The directive should be log-format, not log format. However, custom log formats aren't available in 1.4.x; you'd need to upgrade to 1.5 in order to use that.

Related Topic