At 01:48 PM 12/29/2005 +1100, you wrote: > >Hi everyone, > >I am using log4j under Tomcat 5.0 with log4j.properties file. >When I perform unit test outside of Tomcat I can see log from >some deep level of call stack. However, it isn't the case when >I use the same components inside Tomcat. It looks like Tomcat >filters out the logs coming from the deep level of call stack. >I ran Tomcat in console mode to see the standard output from >that deep level calls. I cannot see the standard output calls ( only >the deep level calls ) either. > >Is there a way to change this behaviour ? >
Do you have log4j.jar in WEB-INF/lib? If not, do that. Also, are there any cases of a log4j.xml in the classpath (default package, maybe hidden inside a jar, in the app or server)? Log4j's default initialization (in a static block of LogManager) loads log4j.xml in preference to log4j.properties. It is possible that you are picking up some other configuration, which might explain why you don't see the logging you expect. Of course, if you don't have log4j.jar in WEB-INF/lib, then you are almost certainly not using the configuration you expect because log4j would have already been configured at the server level (if log4j.jar exists there, which it must if you didn't include it in WEB-INF/lib).
Anyway, try those suggestions out and see if it solves your problem. I suggest you simply move to an XML config file, both to guarantee that you pick of the configuration that you expect and to gain some extra configuration possibilities because there is some stuff that isn't supported by properties files that is supported by XML config files.
Jake > >Thanks > > >Hakan > > >This email may contain privileged/confidential information. You may not copy >or disclose this email to anyone without the written permission of the >sender. If you have received this email in error please kindly delete this >message and notify the sender. Opinions expressed in this email are those >of the sender and not necessarily the opinions of the employer. > >This email and any attached files should be scanned to detect viruses. No >liability will be accepted by the employer for loss or damage (whether >caused by negligence or not) as a result of email transmission. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
