extract first marker when caller locationAwareLogger

Signed-off-by: ceki <ceki@qos.ch>
This commit is contained in:
ceki 2025-11-01 20:09:13 +01:00
parent 902b463957
commit 34c9d30af5
1 changed files with 2 additions and 2 deletions

View File

@ -169,10 +169,10 @@ public class DefaultLoggingEventBuilder implements LoggingEventBuilder, CallerBo
}
private void logViaLocationAwareLoggerAPI(LocationAwareLogger locationAwareLogger, LoggingEvent aLoggingEvent) {
String msg = aLoggingEvent.getMessage();
List<Marker> markerList = aLoggingEvent.getMarkers();
Marker firstMarker = (markerList != null && !markerList.isEmpty()) ? markerList.get(0) : null;
String mergedMessage = mergeMarkersAndKeyValuePairsAndMessage(aLoggingEvent);
locationAwareLogger.log(null, aLoggingEvent.getCallerBoundary(), aLoggingEvent.getLevel().toInt(),
locationAwareLogger.log(firstMarker, aLoggingEvent.getCallerBoundary(), aLoggingEvent.getLevel().toInt(),
mergedMessage,
aLoggingEvent.getArgumentArray(), aLoggingEvent.getThrowable());
}