public class LogInterceptor extends Object implements okhttp3.Interceptor
Interceptor| Constructor and Description |
|---|
LogInterceptor(Logger logger)
Creates a LogInterceptor, taking a logger to be logged to, once a request comes in.
|
| Modifier and Type | Method and Description |
|---|---|
okhttp3.Response |
intercept(okhttp3.Interceptor.Chain chain)
Log the incomming request.
|
public LogInterceptor(Logger logger)
logger - a nonnull logger to be used.IllegalArgumentException - if a null logger was given.public okhttp3.Response intercept(okhttp3.Interceptor.Chain chain)
throws IOException
Once a request gets triggered in okhttp3, this interceptor gets called.
intercept in interface okhttp3.Interceptorchain - the chain of interceptor, provided by the okhttp3.IOException - in case of failure down the line.Copyright © 2026 Contentful, GmbH.. All rights reserved.