Spring mvc jackson: log data

I have a question: mgc and jackson mapper: every time I call the recreation service, passing the wrong json (empty, wron params, ...), the client gets the error correctly, but there is no way, see the server-side call for details. Is there a way to correctly register this information?

Thanks in advance for your help.

Fabio

+3
source share
1 answer

A good place to start the sorting process is AbstractMessageConverterMethodProcessor.writeWithMessageConvertersto give you a good overview of what is being done.

Regarding the logging aspect, the first of the catchentire marshalling / non-marshalling process is ServletInvocableHandlerMethod.invokeAndHandle:

catch (Exception ex) {
   if (logger.isTraceEnabled()) {
      logger.trace(getReturnValueHandlingErrorMessage("Error handling return value", returnValue), ex);
   }
   throw ex;
}

- TRACE - org.springframework.web.servlet.mvc.method.annotation .

, , - DEBUG TRACE: DispatcherServlet.processHandlerException.

, .

+3

All Articles