You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Christian Hufgard <ch...@gmx.de> on 2004/01/13 15:08:15 UTC

How to modify log4.properties while webapps is running?

Hi,

I am using log4j 1.2 within a Tomcat 1.4.28. log4j.jar is deployed uder
WEB-INF/libs. If I use the PropertyConfigurator.configureAndWatch(url) method and
change something in the file referenced by url, i get the following message
written to my catalina.out:

WebappClassLoader: Lifecyle error : CL stopped

I read in another post that there was a bug in Tomcat 1.4.18, but did not
find any solution to the above problem.

Thanks in advance,

Christian

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



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


Re: How to modify log4.properties while webapps is running?

Posted by Christian Hufgard <ch...@gmx.de>.
Sorry for this follow-up, 

have to correct me a little bit. After about 30 seconds (and some dozen
Lifecyle Errors in catalina.out) log4j logs with the changed values.
Still the question: What can I do to stop this error from occuring?

Christian

> Hi,
> 
> I am using log4j 1.2 within a Tomcat 1.4.28. log4j.jar is deployed uder
> WEB-INF/libs. If I use the PropertyConfigurator.configureAndWatch(url)
> method and
> change something in the file referenced by url, i get the following
> message
> written to my catalina.out:
> 
> WebappClassLoader: Lifecyle error : CL stopped
> 
> I read in another post that there was a bug in Tomcat 1.4.18, but did not
> find any solution to the above problem.
> 
> Thanks in advance,
> 
> Christian
> 
> -- 
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 

-- 
+++ GMX - die erste Adresse für Mail, Message, More +++
Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net



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


Re: How to modify log4.properties while webapps is running?

Posted by Jacob Kjome <ho...@visi.com>.
Turn off reloading in Tomcat by setting <Context ... reloadable="false"/>

Tomcat looks for any modified resources when reloadable="true" and restarts the
application.  This is probaly the issue.  Additionally, you should be calling
LogManager.shutdown() upon application shutdown.  This closes any and all
appenders and shuts down the thread created by configureAndWatch() which holds a
handle on your file.  You might also want to avoid using configureAndWatch
because of this, anyway...and the fact that webapps should be able to be
deployed via a .war file and not need to be served from a directory on the file
system.  configureAndWatch() requrires file system access to your webapp.   You
are better off making config changes via a Log4j config servlet.  There are a
few around.  Check the archives and the Log4j docs (and the log4j-sandbox).

Jake

Quoting Christian Hufgard <ch...@gmx.de>:

> Hi,
> 
> I am using log4j 1.2 within a Tomcat 1.4.28. log4j.jar is deployed uder
> WEB-INF/libs. If I use the PropertyConfigurator.configureAndWatch(url) method
> and
> change something in the file referenced by url, i get the following message
> written to my catalina.out:
> 
> WebappClassLoader: Lifecyle error : CL stopped
> 
> I read in another post that there was a bug in Tomcat 1.4.18, but did not
> find any solution to the above problem.
> 
> Thanks in advance,
> 
> Christian
> 
> --
> +++ GMX - die erste Adresse für Mail, Message, More +++
> Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org

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