我的拦截器声明如下所示:
<bean id="loggingInterceptor"
class="org.springframework.aop.interceptor.CustomizableTraceInterceptor">
<property name="enterMessage" value="Enter: $[targetClassShortName].$[methodName]($[arguments])"/>
<property name="exitMessage" value="Exit: $[targetClassShortName].$[methodName](...) returning [$[returnValue]]"/>
</bean>与Pointcuts:
<aop:config proxy-target-class="true">
<aop:advisor advice-ref="loggingInterceptor"
pointcut="execution(public * com.mycompany.server..*.*(..))"/>
</aop:config>但CustomizableTraceInterceptor没有留下任何痕迹。
我甚至实现了我自己的拦截器,它扩展了CustomizableTraceInterceptor并覆盖了writeToLog方法,放置System.out.println只是为了查看类是否被调用。事实并非如此。
有人能看到我错过了什么吗?
发布于 2012-09-29 14:55:59
您需要设置bean CustomizableTraceInterceptor的loggername属性。还要确保将日志级别设置为跟踪。
您可以为记录器类声明任何名称--您正在编写的这个类是跟踪log4j配置的一部分。
https://stackoverflow.com/questions/12150666
复制相似问题