CallLoggingConfig

class CallLoggingConfig

A configuration for the CallLogging plugin.

Constructors

Link copied to clipboard
fun CallLoggingConfig()

Functions

Link copied to clipboard
fun disableDefaultColors()

Disables colors in a log message when a default formatter is used.

Link copied to clipboard
fun filter(predicate: (ApplicationCall) -> Boolean)

Allows you to add conditions for filtering requests. In the example below, only requests made to /api/v1 get into a log:

Link copied to clipboard
fun format(formatter: (ApplicationCall) -> String)

Allows you to configure a call log message.

Link copied to clipboard
fun mdc(name: String, provider: (ApplicationCall) -> String?)

Puts a diagnostic context value to MDC with the specified name and computed using the provider function. A value is available in MDC only during ApplicationCall lifetime and is removed after a call processing.

Properties

Link copied to clipboard
var level: Level

Specifies a logging level for the CallLogging plugin. The default level is Level.INFO.

Link copied to clipboard
var logger: Logger? = null

Specifies a Logger used to log requests. By default, uses ApplicationEnvironment.log.