HttpLoggingInterceptor

class HttpLoggingInterceptor @JvmOverloads constructor(logger: HttpLoggingInterceptor.Logger = Logger.DEFAULT) : 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.

Constructors

Link copied to clipboard
constructor(logger: HttpLoggingInterceptor.Logger = Logger.DEFAULT)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
Link copied to clipboard
fun interface Logger

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open override fun intercept(chain: Interceptor.Chain): Response
Link copied to clipboard
fun redactHeader(name: String)
Link copied to clipboard
fun redactQueryParams(vararg name: String)
Link copied to clipboard

Sets the level and returns this.