Skip to content

Commit

Permalink
don't add "<not-provided>" correlation-id to published logs, fixed al…
Browse files Browse the repository at this point in the history
…so for debug log

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@bosch.io>
  • Loading branch information
thjaeckle committed Nov 10, 2021
1 parent 7b124e9 commit ef5ab31
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit ef5ab31

Please sign in to comment.