public final class HttpLoggingInterceptor
extends Object
implements okhttp3.Interceptor
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.
This custom version redacts security sensitive headers like "Authorization"
| Modifier and Type | Class and Description |
|---|---|
static class |
HttpLoggingInterceptor.Level |
static interface |
HttpLoggingInterceptor.Logger |
| Constructor and Description |
|---|
HttpLoggingInterceptor() |
HttpLoggingInterceptor(HttpLoggingInterceptor.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
HttpLoggingInterceptor.Level |
getLevel() |
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain) |
HttpLoggingInterceptor |
setLevel(HttpLoggingInterceptor.Level level)
Change the level at which this interceptor logs.
|
public HttpLoggingInterceptor()
public HttpLoggingInterceptor(HttpLoggingInterceptor.Logger logger)
public HttpLoggingInterceptor setLevel(HttpLoggingInterceptor.Level level)
level - new logging Levelpublic HttpLoggingInterceptor.Level getLevel()
public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
intercept in interface okhttp3.InterceptorIOException