okhttpclient 添加日志过滤器
添加pom文件
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.10.0</version>
</dependency>
添加intercetpor
HttpLoggingInterceptor logging = new HttpLoggingInterceptor();
logging.setLevel(Level.BODY);
builder.addInterceptor(logging);
日志界别
参考
https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor
欢迎大家访问:
我的博客