OkHttp3 logging interceptor

HTTP logging intercepter for OkHttp3

License

License

The Apache Software License, Version 2.0
Categories

Categories

Logging Application Layer Libs
GroupId

GroupId

com.jleth.util
ArtifactId

ArtifactId

okhttp3-logging
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

OkHttp3 logging interceptor
HTTP logging intercepter for OkHttp3
Project URL

Project URL

https://github.com/JeppeLeth/HttpLogging
Source Code Management

Source Code Management

https://github.com/JeppeLeth/HttpLogging

Download okhttp3-logging

How to add to project

<!-- https://jarcasting.com/artifacts/com.jleth.util/okhttp3-logging/ -->
<dependency>
    <groupId>com.jleth.util</groupId>
    <artifactId>okhttp3-logging</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/com.jleth.util/okhttp3-logging/
implementation 'com.jleth.util:okhttp3-logging:1.0.2'
// https://jarcasting.com/artifacts/com.jleth.util/okhttp3-logging/
implementation ("com.jleth.util:okhttp3-logging:1.0.2")
'com.jleth.util:okhttp3-logging:jar:1.0.2'
<dependency org="com.jleth.util" name="okhttp3-logging" rev="1.0.2">
  <artifact name="okhttp3-logging" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.jleth.util', module='okhttp3-logging', version='1.0.2')
)
libraryDependencies += "com.jleth.util" % "okhttp3-logging" % "1.0.2"
[com.jleth.util/okhttp3-logging "1.0.2"]

Dependencies

runtime (1)

Group / Artifact Type Version
com.squareup.okhttp3 : okhttp jar 3.2.0

Project Modules

There are no modules declared in this project.

HttpLogging

HTTP logging interceptor for OkHttp2 and OkHttp3

For more information please see the website.

Download

Using OkHttp2: Download the latest JAR or grab via Maven: Maven Central Bintray

<dependency>
  <groupId>com.jleth.util</groupId>
  <artifactId>okhttp2-logging</artifactId>
  <version>1.0.1</version>
</dependency>

or Gradle:

compile 'com.jleth.util:okhttp2-logging:1.0.1'

Using OkHttp3: Download the latest JAR or grab via Maven: Maven Central Bintray

<dependency>
  <groupId>com.jleth.util</groupId>
  <artifactId>okhttp3-logging</artifactId>
  <version>1.0.2</version>
</dependency>

or Gradle:

compile 'com.jleth.util:okhttp3-logging:1.0.2'

Usage

To use the logging interceptor to the OkHttpClient in your project, do the following:

OkHttpClient.Builder builder = new OkHttpClient.Builder();
Interceptor loggingInterceptor = new LoggingInterceptorOkHttp3(new LoggingInterceptorOkHttp3.Logger() {
            @Override
            public void info(String log) {
                System.out.println(log);
            }
        });
clientBuilder.addInterceptor(loggingInterceptor);
OkHttpClient okClient = builder.build();

Snapshots of the development version are available in Sonatype's snapshots repository.

License

Copyright 2015 Jeppe Leth Nielsen

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
1.0.2
1.0.1