How to log the incoming json request in spring restful webservice with restcontroller?
<p>I want to log all the incoming requests which will be in json format.I am using spring @RestController and @RequestBody annotations to bind the incoming json content to java objects.But i want to log these requests to logger files.I have searched around for objectmapper and jacksonbinding.</p>

<pre><code>@RestController
public class restClassName{

@RequestMapping(value={"/uri"})
public ObjectResponse functionRestName(@RequestBody ObjectRequest or){
  String jsonInString = mapper.writeValueAsString(staff);//Redundant stuff as the request json is already read by MappingJackson2HttpMessageConverter
  logger.info("request::"+jsonInString)
  return instance;
}
}
</code></pre>

<p>But this seems to be a rendundant way of doing.Since MappingJackson2HttpMessageConverter already reads the httprequest to convert json request to java object.I just need to log the json before  MappingJackson2HttpMessageConverter converts the request json to java object.</p>