From ca5341f1e2b7425faeabf2b345605d180d2f32b7 Mon Sep 17 00:00:00 2001 From: Trevor Dyck Date: Sun, 31 May 2026 09:05:22 -0700 Subject: [PATCH] [AMQ-9288] Fix TransportConnection logger to include exception message on Async Error Backport of AMQ-9288 (commit b751428eb, PR #1038) to the 5.19.x branch. When an async error occurs and DEBUG is not enabled, TransportConnection logged at WARN with a message string that had no '{}' placeholder while passing e.getMessage() as a parameter. SLF4J therefore dropped the argument and logged only the bare text "Async error occurred" with no detail, making the failure undiagnosable at the default log level. Add the '{}' placeholder so the exception message is included, matching the fix already present on the 6.x branches. The Throwable is intentionally not passed (full stack traces at WARN were deliberately removed in AMQ-8548); DEBUG continues to log the full trace. --- .../java/org/apache/activemq/broker/TransportConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java index 2ede7a547d1..b6c35cfb10c 100644 --- a/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java +++ b/activemq-broker/src/main/java/org/apache/activemq/broker/TransportConnection.java @@ -312,7 +312,7 @@ public void serviceException(Throwable e) { if (SERVICELOG.isDebugEnabled()) { SERVICELOG.debug("Async error occurred: {}", e.getMessage(), e); } else { - SERVICELOG.warn("Async error occurred", e.getMessage()); + SERVICELOG.warn("Async error occurred: {}", e.getMessage()); } ConnectionError ce = new ConnectionError(); ce.setException(e);