Siva, Our team actually just encountered this issue. The cause is that the first call to Log4J's configure() dominates over any subsequent calls. The only completely reliable way to ensure your log4j.properties gets loaded first ahead of Tomcat's, Axis's, etc.. is to pass it as a sysprop to the Tomcat JVM at startup.
Here's the batch file we've been using to start Tomcat, which fixes the problem: @echo off # set the below according to the location of your log4j.properties file... set JAVA_OPTS=-Dlog4j.configuration=com/hp/wsm/impact/config/log4j.properties echo JAVA_OPTS env var has been set to '%JAVA_OPTS%' if x%CATALINA_HOME% == x goto catalina_home_not_set echo Starting Tomcat from install dir '%CATALINA_HOME%'... call %CATALINA_HOME%\bin\startup.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 echo Done. goto end :catalina_home_not_set echo ERROR: The CATALINA_HOME environment variable must be set in your System Environment before this batch file can be run. >&2 set EXIT_CODE=1 goto abort :abort echo Aborting... >&2 exit /b %EXIT_CODE% :end Regards, Ian | -----Original Message----- | From: Jagadeesan,Sivakumar | [mailto:[EMAIL PROTECTED] | Sent: Thursday, March 27, 2003 10:35 AM | To: 'Jakarta Commons Users List' | Subject: RE: Commons -Logging and Log4J | | | I am actually putting the commons-logging and log4j jar files in | <Tomcat-home>/webapps/myweb/WEB-INF/classes. | | Do I need to put them in | <Tomcat-home>/webapps/myweb/WEB-INF/lib instead ? | | | | -----Original Message----- | From: Stephen Westbom [mailto:[EMAIL PROTECTED] | Sent: Thursday, March 20, 2003 6:16 PM | To: Jakarta Commons Users List | Subject: Re: Commons -Logging and Log4J | | | I bet you are not putting the commons-logging and log4j jar | files in the web | app's lib directory in the deployment. The server's class | loaders just | don't | see your configuration file. | | --- Thomas Lionel SMETS <[EMAIL PROTECTED]> wrote: | > Why don't youpost the config file + the directory structure so we | > cangive them a look ;-) | > Thomas, | > | > Jagadeesan,Sivakumar wrote: | > > | > > | > > | > > Hi All: | > > | > > I am using commons logging and Log 4 J in my web app that is | > > deployed in Tomcat. | > > I have commons-logging point to Log4 J and I have the Log4J | > > configuration file. But for some reason commons | logging instead of | > > using Log4J it using the default logger and logging only in my | > > console, not in the files that I have defined in my Log4J | > > configuration file | > > | > > --Siva Jagadeesan | > > | > > | > > | -------------------------------------------------------------- | ---------- | > > | > > | --------------------------------------------------------------------- | > > To unsubscribe, e-mail: | [EMAIL PROTECTED] | > > For additional commands, e-mail: | [EMAIL PROTECTED] | > | > | > -- | > Thomas SMETS | > SCJP2 - Brussels | > | > http://tsmets.lautre.net | > | > | > | --------------------------------------------------------------------- | > To unsubscribe, e-mail: [EMAIL PROTECTED] | > For additional commands, e-mail: | [EMAIL PROTECTED] | > | | | __________________________________________________ | Do you Yahoo!? | Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop! | http://platinum.yahoo.com | | --------------------------------------------------------------------- | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | | --------------------------------------------------------------------- | To unsubscribe, e-mail: [EMAIL PROTECTED] | For additional commands, e-mail: [EMAIL PROTECTED] | --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]