Skip to content

Instantly share code, notes, and snippets.

@jfuerth
Created March 12, 2018 14:53
Show Gist options
  • Select an option

  • Save jfuerth/0c4a3dd9d7285941af55a6be76f315e2 to your computer and use it in GitHub Desktop.

Select an option

Save jfuerth/0c4a3dd9d7285941af55a6be76f315e2 to your computer and use it in GitHub Desktop.

Revisions

  1. jfuerth created this gist Mar 12, 2018.
    21 changes: 21 additions & 0 deletions TraceLogger.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    private static class TraceLogger implements okhttp3.logging.HttpLoggingInterceptor.Logger {

    /*
    .client(new OkHttpClient(new okhttp3.OkHttpClient.Builder()
    .addInterceptor(new okhttp3.logging.HttpLoggingInterceptor(
    new TraceLogger(LoggerFactory.getLogger(FEIGN_TARGET)))
    .setLevel(HttpLoggingInterceptor.Level.BODY))
    .build()))
    */
    private final org.slf4j.Logger slf4jLogger;

    private TraceLogger(org.slf4j.Logger slf4jLogger) {
    this.slf4jLogger = slf4jLogger;
    }

    @Override
    public void log(String message) {
    slf4jLogger.trace(message);
    }
    }