Jednoduché logování ve Springu


<bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
<property name="proxyTargetClass" value="true"/>
<property name="beanNames" value="*Manager,*Storage"/>
<property name="interceptorNames" value="loggingAdvice"/>
</bean>
<bean id="loggingAdvice" class="org.springframework.aop.interceptor.CustomizableTraceInterceptor">
<property name="useDynamicLogger" value="true"/>
<property name="hideProxyClassNames" value="true"/>
<property name="enterMessage" value="Entering method '$[methodName]' of class [$[targetClassShortName]], args: $[arguments]"/>
<property name="exitMessage" value="Exiting method '$[methodName]' of class [$[targetClassShortName]], returned: $[returnValue], execution time: $[invocationTime]"/>
<property name="exceptionMessage" value="Exception $[exception] thrown in method '$[methodName]' of class [$[targetClassShortName]]"/>
</bean>