Functional Logging Library based on SL4J and Logback
klogging is a functional approach to dealing with logging in json format with support for markers
The library can be obtained from Jitpack.
repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.sahlone:klogging:$version'
}
Create Logger object
val logger = createContextualLogger()
Log statement examples. Please look into test cases for more examples.
logger.debug(TracingContext(), {"data" to DataObject()}) { "A debug message" }
logger.errorWithCause(TracingContext(),throwable, {"data" to DataObject()}) { "A error message" }
Don't shy away from creating a github issue, A PR for the fix is always welcome as well.