]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: Preserve message facility when the log target is a ring buffer
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 19 Oct 2022 06:16:48 +0000 (08:16 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Oct 2022 07:03:19 +0000 (09:03 +0200)
When a ring is used as log target, the original facility, if any, must be
preserved. The default facility must only be used if there no facility was
found in the incoming log message.

This patch should fix the issue #1901. It must be backported as far as 2.4.

src/log.c

index 07b6b75e4582627a7f372781d980b2bb3b4d179e..b3865e99e440b8c9b9f402df58121bd16f44be9a 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1684,7 +1684,7 @@ static inline void __do_send_log(struct logsrv *logsrv, int nblogger, int level,
                msg = ist2(message, size);
                msg = isttrim(msg, logsrv->maxlen);
 
-               sent = sink_write(logsrv->sink, &msg, 1, level, logsrv->facility, metadata);
+               sent = sink_write(logsrv->sink, &msg, 1, level, facility, metadata);
        }
        else if (logsrv->addr.ss_family == AF_CUST_EXISTING_FD) {
                struct ist msg;