我该如何在使用Spring
编写的REST
服务上自动记录任何传入的GET
url请求?
@RestController
public class MyRest {
@RequestMapping(method = RequestMethod.GET,
produces = MediaType.APPLICATION_XML_VALUE)
@ResponseBody
public ComplexRsp test() {
//...
}
}
我之前用过 cxf
来处理 soap
相关内容,其中使用注解 @InInterceptors, @OutInterceptors
就可以轻松实现日志记录。
那么在 Spring 中是否有类似的功能来处理 rest
呢?