okhttp-logging-interceptor / okhttp3.logging / HttpLoggingInterceptor

HttpLoggingInterceptor

class HttpLoggingInterceptor : Interceptor

An OkHttp interceptor which logs request and response information. Can be applied as an application interceptor or as a OkHttpClient.networkInterceptors.

The format of the logs created by this class should not be considered stable and may change slightly between releases. If you need a stable logging format, use your own interceptor.

Types

Name Summary
Level enum class Level
Logger interface Logger

Constructors

Name Summary
<init> An OkHttp interceptor which logs request and response information. Can be applied as an application interceptor or as a OkHttpClient.networkInterceptors.HttpLoggingInterceptor(logger: Logger = Logger.DEFAULT)

Properties

Name Summary
level var level: Level

Functions

Name Summary
intercept fun intercept(chain: Chain): Response
redactHeader fun redactHeader(name:String):Unit
setLevel Sets the level and returns this.fun setLevel(level: Level):HttpLoggingInterceptor