Spring ResponseEntityExceptionHandler and original POST payload on validation error
<p>I'm using <code>ResponseEntityExceptionHandler</code> in a <strong>Spring Boot</strong>-based RESTFul application, to capture errors in a single place and output a consistent error payload.</p>

<p>Everything works as expected. A class that extends <code>ResponseEntityExceptionHandler</code> can override <code>handleMethodArgumentNotValid</code> in order to "react" on a client sending a message that doesn't pass the validation.
Currently, validation is triggered by annotating the Request Body with the <code>@Valid</code> annotation.</p>

<p>Everything works as expected. If a client POST a JSON document which doesn't validate, the code in the <code>handleMethodArgumentNotValid</code> is executed correctly.</p>

<p>Now, for monitoring purposes, I would like to log the invalid JSON. Obviously, the original <code>InputStream</code> is closed.</p>

<p>I solved a similar problem <a href="https://stackoverflow.com/q/39250847/6564279">recently</a> by sublcassing <code>MappingJackson2HttpMessageConverter</code>, but in the case in the link I needed to "hook" into the validation process and thrown a custom exception containing the invalid JSON document.</p>

<p>Any pointers?</p>