title: Logging with Retrofit 2
body: <p>I'm trying to get the exact JSON that is being sent in the request. Here is my code:</p>
  
  <pre class="lang-java prettyprint-override"><code>OkHttpClient client = new OkHttpClient();
  client.interceptors().add(new Interceptor(){
     @Override public com.squareup.okhttp.Response intercept(Chain chain) throws IOException {
        Request request = chain.request();
        Log.e(String.format("\nrequest:\n%s\nheaders:\n%s",
                            request.body().toString(), request.headers()));
        com.squareup.okhttp.Response response = chain.proceed(request);
        return response;
     }
  });
  Retrofit retrofit = new Retrofit.Builder()
     .baseUrl(API_URL)
     .addConverterFactory(GsonConverterFactory.create())
     .client(client).build();
  </code></pre>
  
  <p>But I only see this in the logs:</p>
  
  <pre><code>request:
  com.squareup.okhttp.RequestBody$1@3ff4074d
  headers:
  Content-Type: application/vnd.ll.event.list+json
  </code></pre>
  
  <p>How am I supposed to do proper logging, given the removal of <code>setLog()</code> and <code>setLogLevel()</code> which we used to use with Retrofit 1?</p>