tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: WebappClassLoader.clearReferences removes root Java Logger handlers
Date Tue, 11 May 2010 19:15:39 GMT
On 11/05/2010 18:52, Ruslan Gainutdinov wrote:
> Hello!
>
> I am using apache-tomcat-6.0.26 with Tanuki Wrapper.
>
> In this particular setup, Juli is not used (no
> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager) and
> java.util.logging.LogManager returns standard Java SE instance.

This question belongs on the users list. Pretty much the exact same 
question was asked very recently. You could try searching the archives.

Mark

>
> org.apache.catalina.loader.WebappClassLoader.clearReferences() calls Juli
> org.apache.juli.logging.LogFactory.release() which in turn
> issues
> LogManager.getLogManager().reset();
>
> For Juli this, I suppose, means return to pristine state before any
> changes have been done.
> But for Java SE LogManager this REMOVES any handlers in root classloader.
>
> This causes all logging to stop after such event as web application
> redeployment.
>
> I propose following change to Juli org.apache.juli.logging.LogFactory:
>
> --- LogFactory.orig
> +++ LogFactory.java
> @@ -328,9 +328,11 @@
>        */
>       public static void release(
>               @SuppressWarnings("unused") ClassLoader classLoader) {
> +        if (LogManager.getLogManager() instanceof ClassLoaderLogManager) {
>           // JULI's log manager looks at the current classLoader
>           LogManager.getLogManager().reset();
> +     }
>      }
>
> P.S. If needed, I can create bug in bugzilla.
>
> With kindest personal regards,
> Ruslan Gainutdinov
> <ruslanfg@gmail.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: dev-help@tomcat.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message