mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 23:31:40 +02:00
It happens that all of them call parse_logformat_line() which sets proxy->to_log with a number of flags affecting the line format for all three users. For example, having a unique-id specified disables the default log-format since fe->to_log is tested when the session is established. Similarly, having "option logasap" will cause "+" to be inserted in unique-id or headers referencing some of the fields depending on LW_BYTES. This patch first removes most of the dependency on fe->to_log whenever possible. The first possible cleanup is to stop checking fe->to_log for being null, considering that it always contains at least LW_INIT when any such usage is made of the log-format! Also, some checks are wrong. s->logs.logwait cannot be nulled by "logwait &= ~LW_*" since LW_INIT is always there. This results in getting the wrong log at the end of a request or session when a unique-id or add-header is set, because logwait is still not null but the log-format is not checked. Further cleanups are required. Most LW_* flags should be removed or at least replaced with what they really mean (eg: depend on client-side connection, depend on server-side connection, etc...) and this should only affect logging, not other mechanisms. This patch fixes the default log-format and tries to limit interferences between the log formats, but does not pretend to do more for the moment, since it's the most visible breakage.