Announcement Announcement Module
Collapse
No announcement yet.
No message logged for CustomTraceInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No message logged for CustomTraceInterceptor

    I have included a custom MethodInterceptor and CustomTraceInterceptor in my servlet.xml. The custom MethodInterceptor extends the MethodInterceptor.

    The custom MethodInterceptor is working fine but the CustomTraceInterceptor does not. I am not sure what is missing.

    My configuration is as follows:

    <bean id="customTraceInterceptor" class="org.springframework.aop.interceptor.Customi zableTraceInterceptor">
    <property name="useDynamicLogger" value="true" />
    </bean>

    <bean id="customInterceptor" class="base.aop.interceptor.CustomMethodIntercepto r"></bean>


    <bean id="txProxyTemplate_JDBC" abstract="true" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager"><ref bean="jdbcTransactionManager"/></property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>

    <bean id="bizManagerTarget" parent="txProxyTemplate_JDBC">
    <property name="target">
    <bean class="service.impl.BizManagerImpl">
    <property name="bizDAO"><ref bean="bizDAO"/></property>
    </bean>
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    </bean>


    <bean id="bizManager" class="org.springframework.aop.framework.ProxyFact oryBean">
    <property name="proxyInterfaces">
    <value>service.BizManager</value>
    </property>
    <property name="target">
    <ref local="bizManagerTarget"/>
    </property>
    <property name="interceptorNames">
    <list>
    <value>customInterceptor</value>
    <value>customTraceInterceptor</value>
    </list>
    </property>
    </bean>

  • #2
    In order to see something in the log CustomizableTraceInterceptor checks if logging is enabled. In your case useDynamicLogger is set to true meaning that the logger name used is the name of the class that contains the method being invoked. In your case the class on which the CustomizableTraceInterceptor is looking is actualy the proxy class created by TransactionProxyFactoryBean not the class service.impl.BizManagerImpl and for this class tracing is not enabled.
    To validate the facts above first set useDynamicLogger to false (or remove the property from configuration) and enable tracing for org.springframework.aop.interceptor.CustomizableTr aceInterceptor. In this case CustomizableTraceInterceptor.

    Comment

    Working...
    X