HTTP body logging is not often performed. This is probably the main reason for RequestDumpingHandler in Undertow just to register header values. Also keep in mind that the request body is not always very interesting to register. Consider using WebSockets or transferring large files, for example. You can write your own MessageBodyReader / Writer for JAX-RS and write it to ByteArrayOutputStream first and then capture the captured content before transferring it. However, given the proven incontrovertibility of this in production, I think that you are mostly interested in how to do this during development.
You can capture HTTP traffic (and virtually any network traffic) using tcpflow or Wireshark. Sometimes people use tools like netcat to quickly write traffic to a file. You can use, for example, the Chrome debugger to read HTTP requests / responses (with their contents).
source share