public class LoggerHttpServletRequestWrapper extends HttpServletRequestWrapper { private final byte[] body; public LoggerHttpServletRequestWrapper(HttpServletRequest request) throws IOException { super(request); body = StreamUtils.readBytes(request.getInputStream()); } @Override public BufferedReader getReader() { return new BufferedReader(new InputStreamReader(getInputStream())); } @Override public ServletInputStream getInputStream() { final ByteArrayInputStream bais = new ByteArrayInputStream(body); return new ServletInputStream() { @Override public boolean isFinished() { return false; } @Override public boolean isReady() { return false; } @Override public void setReadListener(ReadListener readListener) { } @Override public int read() { return bais.read(); } }; } }