commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jagadeesan,Sivakumar" <sivakumar.jagadee...@dhs.state.tx.us>
Subject RE: Commons -Logging and Log4J
Date Thu, 27 Mar 2003 15:56:39 GMT
Okay let me try it locally
But there is one practical issue. I am deploying my web application in one
of the hosting service provider. I do not have access to their startup
script . :(


-----Original Message-----
From: SPRINGER,IAN (HP-NewJersey,ex1) [mailto:ian_springer@hp.com]
Sent: Thursday, March 27, 2003 9:45 AM
To: 'Jakarta Commons Users List'
Cc: CAMPANA,SAL (HP-Philadelphia,ex1); MAZZITELLI,JOHN
(HP-NewJersey,ex2); DZIEMBOWSKI,KINGA (HP-NewJersey,ex2)
Subject: RE: Commons -Logging and Log4J


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:sivakumar.jagadeesan@dhs.state.tx.us] 
| 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:swestbom@yahoo.com]
| 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 <tsmets@brutele.be> 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: 
| commons-user-unsubscribe@jakarta.apache.org
| > > For additional commands, e-mail: 
| commons-user-help@jakarta.apache.org
| > 
| > 
| > -- 
| > Thomas SMETS
| > SCJP2 - Brussels
| > 
| > http://tsmets.lautre.net
| > 
| > 
| > 
| ---------------------------------------------------------------------
| > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
| > For additional commands, e-mail: 
| commons-user-help@jakarta.apache.org
| > 
| 
| 
| __________________________________________________
| Do you Yahoo!?
| Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
| http://platinum.yahoo.com
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: commons-user-help@jakarta.apache.org
| 
| ---------------------------------------------------------------------
| To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
| For additional commands, e-mail: commons-user-help@jakarta.apache.org
| 

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org

Mime
View raw message