OkHttp2 logging interceptor

HTTP logging intercepter for OkHttp2

License

License

The Apache Software License, Version 2.0
Categories

Categories

Logging Application Layer Libs
GroupId

GroupId

com.jleth.util
ArtifactId

ArtifactId

okhttp2-logging
Last Version

Last Version

1.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

OkHttp2 logging interceptor
HTTP logging intercepter for OkHttp2
Project URL

Project URL

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

Source Code Management

https://github.com/JeppeLeth/HttpLogging

Download okhttp2-logging

How to add to project

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

Dependencies

runtime (1)

Group / Artifact Type Version
com.squareup.okhttp : okhttp jar 2.7.2

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.1