From cc90ea78653df29dd7195a3c7227116402ea1317 Mon Sep 17 00:00:00 2001 From: Juan Herrera <66832533+imherrera@users.noreply.github.com> Date: Mon, 3 Jul 2023 01:04:54 -0400 Subject: [PATCH] Append entries of payload to LoggingEventBuilder so implementations can make use of this data --- .../kotlinlogging/slf4j/internal/LocationIgnorantKLogger.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/javaMain/kotlin/io/github/oshai/kotlinlogging/slf4j/internal/LocationIgnorantKLogger.kt b/src/javaMain/kotlin/io/github/oshai/kotlinlogging/slf4j/internal/LocationIgnorantKLogger.kt index 7550178e..74428294 100644 --- a/src/javaMain/kotlin/io/github/oshai/kotlinlogging/slf4j/internal/LocationIgnorantKLogger.kt +++ b/src/javaMain/kotlin/io/github/oshai/kotlinlogging/slf4j/internal/LocationIgnorantKLogger.kt @@ -24,6 +24,7 @@ internal class LocationIgnorantKLogger(override val underlyingLogger: Logger) : KLoggingEventBuilder().apply(block).run { val builder = underlyingLogger.atLevel(level.toSlf4j()) marker?.toSlf4j()?.let { builder.addMarker(it) } + payload?.forEach { (key, value) -> builder.addKeyValue(key, value) } builder.setCause(cause) builder.log(message) }