From: Christopher Faulet Date: Wed, 19 Oct 2022 06:16:48 +0000 (+0200) Subject: BUG/MINOR: log: Preserve message facility when the log target is a ring buffer X-Git-Tag: v2.7-dev9~155 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cc640e851aa22e9ba7c4b5155d099457d1e3989f;p=thirdparty%2Fhaproxy.git BUG/MINOR: log: Preserve message facility when the log target is a ring buffer 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. --- diff --git a/src/log.c b/src/log.c index 07b6b75e45..b3865e99e4 100644 --- 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;