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 Fri, 25 May 2001 20:01:58 GMT


Dan,

Which version of log4j is this? Are you looking at log4j 1.1.1? 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
>classpath.
>
>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?
>
>Dan
>
>
>
>
>---------------------------------------------------------------------
>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


Mime
View raw message