Package mu

Types

Appender
Link copied to clipboard
interface Appender
interface Appender
ConsoleOutputAppender
Link copied to clipboard
object ConsoleOutputAppender : Appender
object ConsoleOutputAppender : Appender
DefaultMessageFormatter
Link copied to clipboard
object DefaultMessageFormatter : Formatter
object DefaultMessageFormatter : Formatter
Formatter
Link copied to clipboard
interface Formatter
interface Formatter
KLoggable
Link copied to clipboard

An interface representing class with logging capabilities implemented using a logger obtain a logger with logger() method

interface KLoggable
KLogger
Link copied to clipboard
common
interface KLogger

An extension for Logger with Lazy message evaluation example:

logger.info{"this is $lazy evaluated string"}

interface KLogger : Logger
KLogging
Link copied to clipboard

A class with logging capabilities usage example:

class ClassWithLogging {
companion object: KLogging()
fun test() {
logger.info{"test ClassWithLogging"}
}
}

open class KLogging : KLoggable
KMarkerFactory
Link copied to clipboard

A platform independent factory to create markers.

common
object KMarkerFactory
object KMarkerFactory
object KMarkerFactory
object KMarkerFactory
KotlinLogging
Link copied to clipboard
common
object KotlinLogging
KotlinLoggingConfiguration
Link copied to clipboard
object KotlinLoggingConfiguration
object KotlinLoggingConfiguration
KotlinLoggingLevel
Link copied to clipboard
enum KotlinLoggingLevel : Enum<KotlinLoggingLevel>
enum KotlinLoggingLevel : Enum<KotlinLoggingLevel>
Marker
Link copied to clipboard

A platform independent marker to enrich log statements.

common
interface Marker
interface Marker
interface Marker
typealias Marker = Marker
NamedKLogging
Link copied to clipboard

A class with logging capabilities and explicit logger name

open class NamedKLogging(name: String) : KLoggable

Functions

isLoggingEnabled
Link copied to clipboard
fun KotlinLoggingLevel.isLoggingEnabled(): Boolean
fun KotlinLoggingLevel.isLoggingEnabled(): Boolean
toKLogger
Link copied to clipboard
fun Logger.toKLogger(): KLogger
withLoggingContext
Link copied to clipboard

Use a vary number of pairs in MDC context. Example:

withLoggingContext("userId" to userId) {
doSomething()
}

inline fun <T> withLoggingContext(vararg pair: Array<Out Pair<String, String>>, body: () -> T): T

Use a pair in MDC context. Example:

withLoggingContext("userId" to userId) {
doSomething()
}

inline fun <T> withLoggingContext(pair: Pair<String, String>, body: () -> T): T

Use a map in MDC context. Example:

withLoggingContext(mapOf("userId" to userId)) {
doSomething()
}

inline fun <T> withLoggingContext(map: Map<String, String>, body: () -> T): T