Announcement Announcement Module
Collapse
No announcement yet.
SimpleTraceInterceptor no console output Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SimpleTraceInterceptor no console output

    Hi,

    i am trying to apply interceptors from spring framework like simpletraceinterceptor or PerformanceMonitorInterceptor and not getting any output statements in console or logs..if i use my own interceptor, then its working fine...any ideas...i tried log4j and commons logging in classpath but still dont see debug or tracing statemens in console or log file..i am using rational application developer for this tesing...any ideas what would be wrong..spring.xml as below



    <beans>
    <bean id="Adder1" class="springex.AdderImpl"/>
    <bean id="Adder2" class="springex.CopyImpl"/>
    <bean id="loggingInterceptor" class="pagecode.LoggingInterceptor"/>

    <bean id="performanceInterceptor" class="org.springframework.aop.interceptor.Perform anceMonitorInterceptor"/>
    <bean id="debugInterceptor" class="org.springframework.aop.interceptor.SimpleT raceInterceptor">
    <property name="useDynamicLogger"><value>true</value></property>
    </bean>
    <bean id="proxyCreator" class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
    <property name="beanNames">
    <value>*</value>
    </property>

    <property name="interceptorNames">
    <list>
    <value>debugInterceptor</value>
    <value>performanceInterceptor</value>
    </list>
    </property>
    </bean>
    </beans>

  • #2
    looks like its log4 configuration thing...is there any way that we can configure these built in interceptors to use certain log4j.xml file instead of reading from different location...i am not able to locate why or where its reading the log4j.xml...everything works fine from command prompt but not from application server or rational application developer...

    Comment


    • #3
      Hi,

      Websphere uses commons logging (same as Spring). If you are running within a Websphere app server with the classloader policy set to 'parent first' (which is the default setting) then Websphere gets to initialise the shared commons logging library with its own LogFactory.

      One way to get around this is to set the classloader policy to 'parent last' for your war or ear classloader and include commons-logging.jar either at the root of your ear or in WEB-INF/lib respectively.

      You can then initialise commons logging to use log4j by configuring the Log4jConfigServlet in your web.xml

      Comment


      • #4
        thanks very much for the information..will try out the class loader policy..

        Comment

        Working...
        X