From 79cc63b1326365c6b4b03f5e8e1e746e7613ee19 Mon Sep 17 00:00:00 2001 From: StrikeW Date: Mon, 16 Dec 2024 21:53:23 +0800 Subject: [PATCH] add --- .../java/com/risingwave/tracing/TracingSlf4jAdapter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/java/connector-node/tracing/src/main/java/com/risingwave/tracing/TracingSlf4jAdapter.java b/java/connector-node/tracing/src/main/java/com/risingwave/tracing/TracingSlf4jAdapter.java index dd552536d05e4..63be7fe4439e6 100644 --- a/java/connector-node/tracing/src/main/java/com/risingwave/tracing/TracingSlf4jAdapter.java +++ b/java/connector-node/tracing/src/main/java/com/risingwave/tracing/TracingSlf4jAdapter.java @@ -36,8 +36,12 @@ private void logIfEnabled(int level, String msg) { private void logIfEnabled(int level, String format, Object arg) { if (TracingSlf4jImpl.isEnabled(level)) { - TracingSlf4jImpl.event( - name, level, new ParameterizedMessage(format, arg).getFormattedMessage()); + var pm = new ParameterizedMessage(format, arg); + if (null != pm.getThrowable()) { + logIfEnabled(level, pm.getFormattedMessage(), pm.getThrowable()); + } else { + TracingSlf4jImpl.event(name, level, pm.getFormattedMessage()); + } } }