users@glassfish.java.net

Re: slf4j - glassfish includes org.slf4j.impl.JDK14LoggerFactory

From: Sahoo <Sahoo_at_Sun.COM>
Date: Thu, 07 Jan 2010 08:47:11 +0530

No, EarLibClassLoader should not delegate to EarClassLoader. I don't
know enough about logback to say what classloader is should use. Having
said that, can't you package logback.xml in a jar in ear/lib? That
should work based on your description of the problem.

Thanks,
Sahoo

glassfish_at_javadesktop.org wrote:
> Thanks Sahoo
>
> It appears to be a bug in Logback. Logback wasn't picking up its logback.xml configuration file and was instead using a default BasicConfiguration.
>
> Logback fails to locate the logback.xml via classLoader.getResource("logback.xml") because of the way it retrieves the ClassLoader
>
> public static ClassLoader getClassLoaderOfClass(Class clazz) {
> ClassLoader cl = clazz.getClassLoader();
> if (cl == null) {
> return ClassLoader.getSystemClassLoader();
> } else {
> return cl;
> }
> }
>
> with clazz = ch.qos.logback.classic.util.ContextInitializer
>
> Since ContextInitializer is in a ear library the code returns a EarLibClassLoader instead of a EarClassLoader.
>
> Should the EarLibClassLoader also delegate to the EarClassLoader or should logback be using Thread.currentThread().getContextClassLoader() ?
> [Message sent by forum member 'dwsmith75' (dsmith_at_nesmi.com)]
>
> http://forums.java.net/jive/thread.jspa?messageID=379078
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>