KtorMonitorInterceptor

class KtorMonitorInterceptor(config: KtorMonitorInterceptorConfig = KtorMonitorInterceptorConfig()) : <ERROR CLASS> ERROR CLASS: Symbol not found for Interceptor

An OkHttp Interceptor that provides the capability to log HTTP calls.

You can learn more from KtorMonitor.

OkHttpClient.Builder()
.addInterceptor(
KtorMonitorInterceptor {
sanitizeHeader { header -> header == "Authorization" }
isActive = true
showNotification = true
retentionPeriod = RetentionPeriod.OneHour
maxContentLength = ContentLength.Default
}
)
.build()

Install it with addInterceptor, not addNetworkInterceptor: OkHttp does not run network interceptors for WebSocket calls, so a WebSocket handshake would not be logged. To also log WebSocket frames, open the socket with newMonitoredWebSocket.

Constructors

Link copied to clipboard
constructor(config: KtorMonitorInterceptorConfig = KtorMonitorInterceptorConfig())
constructor(block: KtorMonitorInterceptorConfig.() -> Unit)

Functions

Link copied to clipboard
open override fun intercept(chain: ERROR CLASS: Symbol not found for Interceptor.Chain): ERROR CLASS: Symbol not found for Response