Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 .

share|improve this question

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.

share|improve this answer
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'. – Abhishek Anand Amralkar Oct 16 '13 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 '13 at 12:49
I even tried that with HaProxy version 1.5 but no luck. – Abhishek Anand Amralkar Mar 12 '14 at 15:07

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.