2

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 .

1 Answer 1

2

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.

3
  • I got same error [ALERT] 288/120615 (14468) : parsing [/etc/haproxy/haproxy.cfg:46] : unknown keyword 'log-format' in 'listen' section [ALERT] 288/120615 (14468) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg [ALERT] 288/120615 (14468) : Fatal errors found in configuration. Errors found in configuration file, check it with 'haproxy check'. Oct 16, 2013 at 12:06
  • Sorry, I missed which version you're using. Custom log formats were only introduced in version 1.5, so they don't work in 1.4.22. I'll amend my answer to clarify that.
    – Jenny D
    Oct 16, 2013 at 12:49
  • I even tried that with HaProxy version 1.5 but no luck. Mar 12, 2014 at 15:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .