From ef5ab316ab4cf3b3477fabe8e2401938a66472f4 Mon Sep 17 00:00:00 2001 From: Thomas Jaeckle Date: Wed, 10 Nov 2021 08:15:02 +0100 Subject: [PATCH] don't add "" correlation-id to published logs, fixed also for debug log Signed-off-by: Thomas Jaeckle --- .../monitoring/logs/FluentPublishingConnectionLogger.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/monitoring/logs/FluentPublishingConnectionLogger.java b/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/monitoring/logs/FluentPublishingConnectionLogger.java index 941b03309c..31a6413c4f 100644 --- a/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/monitoring/logs/FluentPublishingConnectionLogger.java +++ b/connectivity/service/src/main/java/org/eclipse/ditto/connectivity/service/messaging/monitoring/logs/FluentPublishingConnectionLogger.java @@ -156,9 +156,9 @@ private void emitLogEntry(final ConnectionMonitor.InfoProvider infoProvider, fin } private void emitLogEntry(final LogEntry logEntry) { + final String correlationId = InfoProviderFactory.FALLBACK_CORRELATION_ID + .equals(logEntry.getCorrelationId()) ? null : logEntry.getCorrelationId(); if (logLevels.contains(logEntry.getLogLevel())) { - final String correlationId = InfoProviderFactory.FALLBACK_CORRELATION_ID - .equals(logEntry.getCorrelationId()) ? null : logEntry.getCorrelationId(); try { final Instant timestamp = logEntry.getTimestamp(); final EventTime eventTime = EventTime.fromEpoch(timestamp.getEpochSecond(), timestamp.getNano()); @@ -193,7 +193,7 @@ private void emitLogEntry(final LogEntry logEntry) { e.getClass().getSimpleName(), e.getMessage()); } } else { - LOGGER.withCorrelationId(logEntry.getCorrelationId()) + LOGGER.withCorrelationId(correlationId) .debug("Not emitting log entry with logLevel <{}> as the configured logLevels contained: <{}>", logEntry.getLogLevel(), logLevels); }