vendredi 20 février 2015

How to enable logging for @RestController?

How can I automatically log any incoming GET url requests on a REST service written with Spring?



@RestController
public class MyRest {
@RequestMapping(method = RequestMethod.GET,
produces = MediaType.APPLICATION_XML_VALUE)
@ResponseBody
public ComplexRsp test() {
//...
}
}


I have used cxf for soap, where logging is as easy as annotation the webservice with @InInterceptors, @OutInterceptors.


Is there anything similar in spring for rest?


Aucun commentaire:

Enregistrer un commentaire