CallLoggingConfig

A configuration for the CallLogging plugin.

Constructors

Link copied to clipboard
constructor()

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?

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

Functions

Link copied to clipboard
fun clock(clock: () -> Long)

Allows you to configure a clock that will be used to measure call processing time.

Link copied to clipboard

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

Link copied to clipboard

Disables logging for static content files.

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.