In our current environment, the haproxy.cfg
has two conflicting options:
option httplog
option tcplog
The resulting log (/var/log/haproxy.log
) looks like:
Jul 16 09:39:05 campus-deploy haproxy[9862]: client_ip:client_port [16/Jul/2018:09:39:01.238] https~ backend/backend_server 0/1/3999 420
-- 12/12/0/0/0 0/0
To me, the log looks more like a tcplog than a httplog (even though the fields are not exactly the same as in the documentation and we do not have custom logs in place).
My questions is the following:
- How does haproxy treat conflicting options?
- Does it take the first fitting option?
- Does it apply the last option (overriding the previous option)?
Thanks in advance for you insights.
Yes, that is a
tcplog
.In this case, it's a not exactly a "conflicting" option, its an option that allows itself to be overridden by a later declaration of a different option.
The last instance from top to bottom in the configuration is used. Why this isn't an error is most likely related to the fact that one such option can be defined in the defaults section, only to be overridden in the individual proxy (frontend, listen, or backend) config.