logging - HAProxy log-format directive ignored -
i've upgraded haproxy 1.6.3, , i've provided default log-format directive http/tcp requests follows:
defaults log-format %hr\ %st\ %b\ %ts log global mode http option dontlognull retries 3 option redispatch option http-server-close maxconn 2000 timeout client 3600s timeout server 3600s timeout connect 5s errorfile 400 /etc/haproxy/errors/400.http errorfile 403 /etc/haproxy/errors/403.http errorfile 408 /etc/haproxy/errors/408.http errorfile 500 /etc/haproxy/errors/500.http errorfile 502 /etc/haproxy/errors/502.http errorfile 503 /etc/haproxy/errors/503.http errorfile 504 /etc/haproxy/errors/504.http however, when restart server , log entries begin written, written using haproxy's default http/tcp log formats:
feb 8 14:55:41 localhost haproxy[6770]: host - - [08/feb/2016:21:55:41 +0000] "post /path/to/service/1.0 http/1.1" 200 841 "" "" 43359 499 "frontend" "backend" "server" 0 0 0 22 22 ---- 0 0 0 0 0 0 0 "" ""
feb 8 14:54:05 localhost haproxy[6771]: host:port [08/feb/2016:14:54:05.469] frontend backend 1/0/4 147 -- 0/0/0/0/0 0/0
why log-format being ignored? receive no warnings or alerts on restart.
even though had configured log-format directive in defaults section, there frontends had set option tcplog , option httplog clf overriding log format had configured.
the haproxy documentation bit misleading here:
this directive specifies log format string used logs resulting traffic passing through frontend using line. if directive used in defaults section, subsequent frontends use same log format.
Comments
Post a Comment