Problem performance Logging using Spring AOP
Hi all,
I am trying to implement performance logging using Spring AOp in my application. But it creates only an empty log file:
Following are the configuration I am doing:
In application context:
Code:
<bean id="springMonitoringAspectInterceptor" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor">
</bean>
<aop:config>
<aop:pointcut id="springMonitoringPointcut" expression="execution(* com.project14.service.common.AppService.execute(..))"/>
<aop:advisor pointcut-ref="springMonitoringPointcut" advice-ref="springMonitoringAspectInterceptor"/>
</aop:config>
In log4j config xml:
Code:
<appender name="perfLog" class="org.apache.log4j.DailyRollingFileAppender">
<param name="Threshold" value="INFO" />
<param name="File" value="${catalina.home}/logs/dashboard_pref.log"/>
<param name="DatePattern" value="'-'yyyy-MM-dd'.log'"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%d{ISO8601}] - %-5p- [%X{USER_ENCRYPT_ID}%x] - %C.%M(%F:%L) - %m %n" />
</layout>
</appender>
<logger name="org.springframework.aop.interceptor.PerformanceMonitorInterceptor" additivity="false">
<level value="TRACE"/>
<appender-ref ref="perfLog"/>
</logger>
aopalliance-1.0.jar
aspectjweaver-1.6.8.jar are in class path. There is no compilation error.
AppService is an interface all the service class implements it's execute method. I want to log execution time of excute method of each service.
I am using spring 3.0 libraries for this project.
Please help.