Spring框架下的 “接口调用、MVC请求” 调用参数、返回值、耗时信息输出
2016-11-28 11:20
344 查看
主要拦截前端或后天的请求,打印请求方法参数、返回值、耗时、异常的日志。方便开发调试,能很快定位到问题出现在哪个方法中。
View Code
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd"> <bean id="externalApiMethodInterceptor" class="com.xxx.flipclass.sdk.framework.aop.ExecutionApiLogMethodInterceptor" /> <aop:config proxy-target-class="true"> <aop:pointcut id="externalApiMethodPointcut" expression="!execution(* com.xxx.flipclass.sdk.client.interfaces..*.loginInfoService.*(..)) and (execution(* com.xxx.*.sdk.client.interfaces..*.*Client*.*(..)) || execution(* com.xxx.*.sdk.client.interfaces..*.*Service*.*(..)))" /> <aop:advisor advice-ref="externalApiMethodInterceptor" pointcut-ref="externalApiMethodPointcut" /> </aop:config> </beans>
View Code
相关文章推荐
- ASP.NET调用存储过程返回值 输入输出参数
- ASP.NET中调用存储过程带(输入/输出)参数和返回值的一些常用的例子
- C#调用存储过程带输出参数或返回值分类(转)
- 对接口参数进行加密调用接口获取信息
- 关于存储过程的ADO调用的一些心得(输出参数,返回值)
- ASP.NET调用存储过程返回输出参数,获得返回值
- c++ ado 调用存储过程并得到输出参数和返回值
- 存储过程输出参数、返回值、返回表及C#调用
- 关于sqlhelper调用存储过程获取参数返回值和输出参数的问题
- 关于调用存储过程获取参数返回值和输出参数注意的问题
- C#调用存储过程 之返回值与输出参数的区别与用法实例
- 接口调用,输出结果为Json格式(ConvertTo-Json),提交参数给URL(WebRequest)
- ASP.NET中调用存储过程带(输入/输出)参数和返回值
- Sql Server 存储过程调用存储过程接收输出参数,返回值
- 接口作为参数,不同的接口调用不同的方法,例如:输出“I love Game”或输出“我喜欢游戏”
- 关于存储过程的ADO调用的一些心得(输出参数,返回值)
- C#调用存储过程详解(带返回值、参数输入输出等)
- C#调用存储过程带输出参数或返回值
- C#调用存储过程带输出参数或返回值
- Sql Server 存储过程调用存储过程接收输出参数,返回值