We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LoggingEventAware
key-value pair was introduced in slf4j 2.x.
For example, we can write like this. Depending on the implementation of appender, key-value pairs can be sent as structured logs.
logger.atInfo().addKeyValue("key1", "value1").log("some message")
However, KLogger does not implement LoggingEventAware, so key-value pairs cannot be used properly. https://github.com/oshai/kotlin-logging/blob/3.x/src/jvmMain/kotlin/mu/KLogger.kt#L12
Currently this code branch has been executed. Therefore, I would like KLogger to implement LoggingEventAware. https://github.com/qos-ch/slf4j/blob/f871e7f2e9f3f3959e987967655dfcb15494a3d3/slf4j-api/src/main/java/org/slf4j/spi/DefaultLoggingEventBuilder.java#L149
Of course, we can write the following. However, it is more time-consuming and easy to make mistakes...
logger.underlyingLogger.atInfo().addKeyValue("key1", "value1").log("some message")
I am aware that kotlin-logging will change significantly in ver4, but it does not seem to be supported in ver4. https://github.com/oshai/kotlin-logging/blob/master/src/commonMain/kotlin/io/github/oshai/KLogger.kt
The text was updated successfully, but these errors were encountered:
Thank you for reporting an issue. See the wiki for documentation and slack for questions.
Sorry, something went wrong.
Hi, At the moment I do not plan to support fluent logging. If you wish to contribute that we can discuss implementation.
Thanks for the reply. I will consider for a while how it should be implemented.
This is added as part of v5 in #329
No branches or pull requests
key-value pair was introduced in slf4j 2.x.
For example, we can write like this.
Depending on the implementation of appender, key-value pairs can be sent as structured logs.
However, KLogger does not implement LoggingEventAware, so key-value pairs cannot be used properly.
https://github.com/oshai/kotlin-logging/blob/3.x/src/jvmMain/kotlin/mu/KLogger.kt#L12
Currently this code branch has been executed. Therefore, I would like KLogger to implement LoggingEventAware.
https://github.com/qos-ch/slf4j/blob/f871e7f2e9f3f3959e987967655dfcb15494a3d3/slf4j-api/src/main/java/org/slf4j/spi/DefaultLoggingEventBuilder.java#L149
Of course, we can write the following. However, it is more time-consuming and easy to make mistakes...
I am aware that kotlin-logging will change significantly in ver4, but it does not seem to be supported in ver4.
https://github.com/oshai/kotlin-logging/blob/master/src/commonMain/kotlin/io/github/oshai/KLogger.kt
The text was updated successfully, but these errors were encountered: