Aug 21st, 2006, 05:48 PM
SimpleTraceInterceptor no console output
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
<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">
<bean id="proxyCreator" class="org.springframework.aop.framework.autoproxy .BeanNameAutoProxyCreator">
Aug 21st, 2006, 11:03 PM
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...
Aug 22nd, 2006, 07:13 PM
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
Aug 23rd, 2006, 08:38 AM
thanks very much for the information..will try out the class loader policy..