logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ceki Gülcü <...@qos.ch>
Subject Re: Loader class
Date Sat, 26 May 2001 06:26:05 GMT


I have read and re-read your mail. I still don't understand it. Regards, Ceki

At 14:43 22.05.2001 -0400, you wrote:
>In the 0.9.1 version of log4j, the ClassLoader was retrieved via:
>        ClassLoader loader = org.log4j.Category.class.getClassLoader();
>now it is retrieved like this:
>        ClassLoader loader = clazz.getClassLoader();
>This allowed the log4j.properties file to be found anywhere in the
>It seems that the ClassLoader object can only be retrieved from a static
>initiazation block of a class that is currently being loaded.
>For example:  If we are in class A, and do:
>        ClassLoader loader = A.class.getClassLoader(); it works
>but if we use any other class:  
>        ClassLoader loader = B.class.getClassLoader(); it does not work
>(returns null)
>So can the line:
>        ClassLoader loader = clazz.getClassLoader();
>be changed to:
>        ClassLoader loader = ClassLoader.class.getClassLoader();
>in some future version of log4j?
>To unsubscribe, e-mail: log4j-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-dev-help@jakarta.apache.org

Ceki Gülcü

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

View raw message