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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]