[slf4j-dev] [JIRA] Updates for SLF4J-601: Wrong class name printed when using LoggingEventBuilder with payload #416
slf4j developers list
slf4j-dev at qos.ch
Tue Apr 9 06:01:00 UTC 2024
SLF4J / SLF4J-601 [Open]
Wrong class name printed when using LoggingEventBuilder with payload #416
==============================
Here's what changed in this issue in the last few minutes.
This issue has been created
This issue is now assigned to you.
View or comment on issue using this link
https://jira.qos.ch/browse/SLF4J-601
==============================
Issue created
------------------------------
Ceki Gülcü created this issue on 09/Apr/24 5:50
Summary: Wrong class name printed when using LoggingEventBuilder with payload #416
Issue Type: Bug
Assignee: SLF4J developers list
Created: 09/Apr/24 5:50
Priority: Major
Reporter: Ceki Gülcü
Description:
The wrong class name is printed when using the LoggingEventBuilder with a payload.
The following example demonstrates the issue:
package my.pkg
import io.github.oshai.kotlinlogging.KotlinLogging
private val logger = KotlinLogging.logger { }
fun main() {
logger.atInfo {
message = "hi"
payload = mapOf("k" to "v")
}
logger.atInfo {
message = "hi"
}
}
Which will print:
Apr. 06, 2024 4:49:02 AM io.github.oshai.kotlinlogging.slf4j.internal.LocationAwareKLogger logWithPayload
INFORMATION: k=v hi
Apr. 06, 2024 4:49:02 AM my.pkg.MyClassKt main
INFORMATION: hi
The first log statement will be logged with io.github.oshai.kotlinlogging.slf4j.internal.LocationAwareKLogger as a classname.
Which is wrong. It supposed to be my.pkg.MyClassKt.
In the second log statement however it seems to work fine.
Check out the example to reproduce the issue: example.zip
==============================
This message was sent by Atlassian Jira (v9.6.0#960000-sha1:a3ee8af)
More information about the slf4j-dev
mailing list