Logging Exception with requests

21 views
Skip to first unread message

Yaz

unread,
Nov 25, 2020, 1:06:57 PM11/25/20
to dropwizard-user
Hi, I don't know if this is possible or not, but I set an Exception Mapper to catch all exceptions, and with it a logging reporter to write the error to a database, I get the information from the request, (headers, query params, cookies, etc), but I can't get the body, the method in ServletRequest getInputStream() gives me a never ending stream without data.

This is a common endpoint for me, is there a way to get the raw request even after json serialization?

@POST
@Path("bulk")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@ManagedAsync
public void create(
MyCustomRequest request,
@Context HttpServletRequest requestContext,
@Suspended final AsyncResponse response) {
delegate().create(request  , requestContext, response);
}


Reply all
Reply to author
Forward
0 new messages