-
Notifications
You must be signed in to change notification settings - Fork 0
Spring Configuration
Instantiate a bean for each tiers to log
Example with two tiers:
<!-- BEAN PERF LOG --> <bean id="myLoggerService" class="org.log4perf.PerfLogger"> <property name="logTag" value="service"/> </bean> <bean id="myLoggerDao" class="org.log4perf.PerfLogger"> <property name="logTag" value="dao"/> </bean>
AOP allows to associate a bean PerfLogger to classes and methods.
Example with to tiers:
<aop:config> <aop:pointcut id="servicePointcut" expression="execution(* com.compagny.project.service.IServiceOperation.*(..))"/> <aop:aspect id="loggingServiceAspect" ref="myLoggerService"> <aop:around pointcut-ref="servicePointcut" method="logAround"/> </aop:aspect> </aop:config> <aop:config> <aop:pointcut id="daoPointcut" expression="execution(* com.compagny.project.dao.IDaoOperation.*(..))"/> <aop:aspect id="loggingDaoAspect" ref="myLoggerDao"> <aop:around pointcut-ref="daoPointcut" method="logAround"/> </aop:aspect> </aop:config>