Logger

class Logger(source)

A logger providing structured logging capabilities.

It allows logging messages with different LogLevels, optional exceptions, and structured attributes.

Functions

Link copied to clipboard
fun debug(throwable: Throwable? = null, attrs: AttrBuilder.() -> Unit = {}, message: () -> String)

Logs a debug message.

Link copied to clipboard
fun error(throwable: Throwable? = null, attrs: AttrBuilder.() -> Unit = {}, message: () -> String)

Logs an error message.

Link copied to clipboard
fun fatal(throwable: Throwable? = null, attrs: AttrBuilder.() -> Unit = {}, message: () -> String)

Logs a fatal message. This will likely cause the application to terminate after processing.

Link copied to clipboard
fun info(throwable: Throwable? = null, attrs: AttrBuilder.() -> Unit = {}, message: () -> String)

Logs an info message.

Link copied to clipboard
fun verbose(throwable: Throwable? = null, attrs: AttrBuilder.() -> Unit = {}, message: () -> String)

Logs a verbose message.

Link copied to clipboard
fun warn(throwable: Throwable? = null, attrs: AttrBuilder.() -> Unit = {}, message: () -> String)

Logs a warning message.

Link copied to clipboard

Returns a logger that attaches ctx to every event it emits.

fun withContext(vararg values: Pair<String, Any?>): Logger

Convenience overload of withContext for building a context inline.