Results 1 to 4 of 4

Thread: SimpleTraceInterceptor no console output

  1. #1
    Join Date
    Aug 2006
    Posts
    21

    Default 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. #2
    Join Date
    Aug 2006
    Posts
    21

    Default

    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...

  3. #3
    Join Date
    Jan 2006
    Location
    London
    Posts
    2

    Default

    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

  4. #4
    Join Date
    Aug 2006
    Posts
    21

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •