KtorMonitorLoggingConfig

A configuration for the KtorMonitorLogging plugin.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Enable or disable the logging of requests and responses. By default:

Link copied to clipboard

The maximum length of the content that will be logged. After this, body will be truncated. By default it is ContentLength.Default. Use ContentLength.Full to log the full content.

Link copied to clipboard

The retention period for the logs. By default it is 1 hour.

Link copied to clipboard

Keep track of latest requests and responses into notification. By default:

Functions

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

Allows you to filter logs for calls matching a predicate.

Link copied to clipboard
fun sanitizeHeader(placeholder: String = "***", predicate: (String) -> Boolean)

Allows you to sanitize sensitive headers to avoid their values appearing in the logs. In the example below, Authorization header value will be replaced with '***' when logging: