On Thu, Sep 13, 2012 at 11:22:16PM +0530, Gagandeep Singh wrote: > Hi all
Hi, > > were getting printed. I wanted to log the unique-id-header, but could not > find any way of doing so. > So i copy pasted the log-format mentioned on the > 1.5/doc/configuration.txt<http://haproxy.1wt.eu/download/1.5/doc/configuration.txt>, > and unique id started getting logged. Unfortunately, now the captured > request headers are not getting logged. After some thought, i though't id > put some delimiters around the %hrl and %hsl and i realized that these are > empty strings. > > Very weird. Here is my config, plzz help :( > > listen server > bind *:80 > mode http > > option httplog You shouldn't use this option with a log-format string, because it sets a default string. > no option logasap # disable early logging of HTTP requests so that > option http-server-close > total transfer time is logged > option forwardfor > capture request header X-Forwarded-For len 500 > capture request header Host len 500 > capture request header X-Request-UID len 500 > rspadd X-Haproxy-Backend:\ server > > # Generate the X-Haproxy-Unique-ID and log it to make it easy to track > requests > log-format %Ci:%Cp\ [id=%ID]\ [%t]\ %f\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %st\ > %B\ %cc\ %cs\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ *{%hrl}\ {%hsl}*\ %{+Q}r > unique-id-format %{+X}o\ %Ci:%Cp_%Fi:%Fp_%Ts_%rt:%pid > unique-id-header X-Haproxy-Unique-ID > > > Here is the log i see: > Sep 13 17:28:57 localhost haproxy[11979]: > 10.161.27.218:41592[id=0AA11BDA:A278_0AA15B71:0050_505217C5_0014:2ECB] > [13/Sep/2012:17:28:37.567] server www-example-com-healthz/- > 19998/0/2/1/+20001 200 +326 - - ---- 10/10/1/1/0 0/0 *{} {}* "GET > /testing/healthz?merchant=www.example.com&source=elb HTTP/1.1" > > > Help will be greatly appreciated. > I don't have any problem with your configuration, which version of HAProxy are you using ? -- William Lallemand

