Spring REST Jackson JSON debug 400

Oh I’m so sick of trying to find this information for myself again when I’ve lost track of it.

Sometimes when you are doing rest calls to SpringMVC and using Jackson you get this nice 400 error  - it is barfing on the format of the request – but everything looks good.  Hmmm…nothing in the log.  Why not?  Because the log isn’t configured to report it.  How can I do such a thing?

log4j.logger.org.springframework.web.servlet.mvc=TRACE

 

ahhh…that felt nice.  The output instead of

becomes

org.springframework.http.converter.HttpMessageNotReadableException: Could not read JSON: Can not deserialize instance of java.lang.String out of START_OBJECT token
at [Source: org.apache.catalina.connector.CoyoteInputStream@79111260; line: 1, column: 2]; nested exception is org.codehaus.jackson.map.JsonMappingException: Can not deserialize instance of java.lang.String out of START_OBJECT token

And this isn’t the best example, usually you get missing properties and such, if you are using jackson to model binding.