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()Content copied to clipboard
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.