title: How to print server responses using LoggingFeature in Dropwizard 1.0.2?
body: <p>The following code results in JSON server responses being printed in Dropwizard 0.9.2 and 1.0.2:</p>
  
  <pre><code>return ClientBuilder
          .newBuilder()
          .build()
          .register(new LoggingFilter(Logger.getLogger(LoggingFilter.class.getName()), true))
  </code></pre>
  
  <p>For example:</p>
  
  <pre><code>Oct 21, 2016 7:57:42 AM org.glassfish.jersey.filter.LoggingFilter log
  INFO: 1 * Client response received on thread main
  1 &lt; 401
  1 &lt; Connection: keep-alive
  1 &lt; Content-Length: 49
  1 &lt; Content-Type: text/plain
  1 &lt; Date: Fri, 21 Oct 2016 07:57:42 GMT
  1 &lt; Server: […]
  1 &lt; WWW-Authenticate: Basic realm="[…]"
  Credentials are required to access this resource.
  
  javax.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized
  </code></pre>
  
  <p>However, <code>LoggingFilter</code> is deprecated in 1.0.2, and it's recommended to use <code>LoggingFeature</code> instead. In the <a href="https://jersey.java.net/apidocs/2.23/jersey/org/glassfish/jersey/logging/LoggingFeature.html" rel="nofollow">documentation of LoggingFeature</a> it says that the default verbosity is <code>LoggingFeature.Verbosity.PAYLOAD_TEXT</code>, so I was expecting the following code to still print JSON server responses in Dropwizard 1.0.2:</p>
  
  <pre><code>return ClientBuilder
          .newBuilder()
          .build()
          .register(new LoggingFeature(Logger.getLogger(getClass().getName())))
  </code></pre>
  
  <p>Instead the log contains just this:</p>
  
  <pre><code>javax.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized
  </code></pre>