Hi,
On Fri, Apr 26, 2013 at 06:10:24PM +0100, Pedro Mata-Mouros wrote:
> Hi everyone,
>
> Having some trouble with using unique-id in logs, in 1.5-dev18. The following
> conf file will completely ignore log-format in defaults. I have to move it to
> the frontend in order for something to appear in the logs. But then, I can't
> get %ID to appear at all:
>
> global
> daemon
> pidfile /var/run/haproxy.pid
> log 127.0.0.1 local5
>
> defaults
> mode http
> timeout server 3s
> timeout client 3s
> timeout connect 3s
> log global
> log-format %{+X}o\ asd\ %ID\ dsa
> option httplog
Option httplog overrides log-format. Please just remove it.
> option dontlognull
>
> frontend in
> bind 127.0.0.1:80
> default_backend localhost
>
> backend localhost
> server host 127.0.0.1:8080
>
>
> And this is the output (sorry, it's tcpdump):
>
> 17:49:29.258838 IP localhost.49956 > localhost.syslog: SYSLOG local5.info,
> length: 47
> 0x0000: 0200 0000 4500 004b 40bf 0000 4011 0000 ....E..K@...@...
> 0x0010: 7f00 0001 7f00 0001 c324 0202 0037 fe4a .........$...7.J
> 0x0020: 3c31 3734 3e41 7072 2032 3620 3137 3a34 <174>Apr.26.17:4
> 0x0030: 393a 3239 2068 6170 726f 7879 5b31 3432 9:29.haproxy[142
> 0x0040: 3236 5d3a 2061 7364 202d 2064 7361 0a 26]:.asd.-.dsa.
>
>
> Spot any problems in that config?
You need to define the unique-id format using "unique-id-format".
Willy