title: Log requests sent with ResteasyClient
body: <p>In our project, we are using <code>Resteasy</code> to implement the client of a REST-API. Our code looks something like:</p>
  <pre><code>ResteasyClient client = ...;
  ResteasyWebTarget target = client.target(&quot;api-path&quot;);
  MyProxyClass proxy = target.proxy(MyProxyClass.class);
  </code></pre>
  <p>where <code>MyProxyClass</code> is defined like this:</p>
  <pre><code>public interface MyProxyClass {
      @POST
      @Path(&quot;/path&quot;)
      @Produces(MediaType.APPLICATION_JSON)
      @Consumes(MediaType.APPLICATION_JSON)
      Response myMethod(MyPayloadClass payload);
  }
  </code></pre>
  <p><code>proxy</code> is then used to submit requests to the REST-API, e.g.</p>
  <pre><code>MyPayloadClass payload = ...;
  proxy.myMethod(payload);
  </code></pre>
  <p>In order to debug our application, we would like to log the <em>exact</em> request that <code>RestEasy</code> sends to the external REST-API. In particular, we would like to see the exact headers and JSON payload so that we can test the requests with an external tool like <code>curl</code>. Notice that, since the marshalling is done automatically / implicitly by the library, we have no access to the entities being sent with the request.</p>
  <p>Is there such a possibility? After a lot of searching and reading in the documentation, we found no hint on how to log requests with <code>RestEasy</code>.</p>