From 5d74980277cffb76e13d1c04eacb9260a46c1202 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 8 Dec 2025 14:52:59 +0100 Subject: [PATCH] BUG/MINOR: log: Dump good %B and %U values in logs When per-stream "bytes_in" and "bytes_out" counters where replaced in 3.3, the wrong counters were used for %B and %U values in logs. In the configuration manual and the commit message, it was specificed that "bytes_in" was replaced by "req_in" and "bytes_out" by "res_in", but in the code, wrong counters were used. It is now fixed. This patch should fix the issue #3208. It must be backported to 3.3. --- src/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/log.c b/src/log.c index 03d350564..3172ca861 100644 --- a/src/log.c +++ b/src/log.c @@ -4629,14 +4629,14 @@ int sess_build_logline_orig(struct session *sess, struct stream *s, case LOG_FMT_BYTES: // %B if (!(fe->to_log & LW_BYTES)) LOGMETACHAR('+'); - ret = lf_int(tmplog, dst + maxsize - tmplog, logs->req_in, ctx, LF_INT_LLTOA); + ret = lf_int(tmplog, dst + maxsize - tmplog, logs->res_in, ctx, LF_INT_LLTOA); if (ret == NULL) goto out; tmplog = ret; break; case LOG_FMT_BYTES_UP: // %U - ret = lf_int(tmplog, dst + maxsize - tmplog, logs->res_out, ctx, LF_INT_LLTOA); + ret = lf_int(tmplog, dst + maxsize - tmplog, logs->req_in, ctx, LF_INT_LLTOA); if (ret == NULL) goto out; tmplog = ret; -- 2.47.3