[slf4j-dev] [Bug 205] make multiple bindings check more intelligent

bugzilla-daemon at qos.ch bugzilla-daemon at qos.ch
Thu Oct 25 22:45:27 CEST 2012


http://bugzilla.slf4j.org/show_bug.cgi?id=205

Tonio <tonioc at exeo.com.ar> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tonioc at exeo.com.ar

--- Comment #3 from Tonio <tonioc at exeo.com.ar> 2012-10-25 22:45:27 CEST ---
Interesting thing I'm facing about this report, I'm dealing with isolated class
loader (ChildFirst) lookup and I'm facing a warning that I think should not be
a warning at all

SystemClassLoader
    +------- logback + slf4 api
    |
    + ChildFirstClassLoader
              +-----------  simple + slf4 api
              +-----------  MyClass.java

When LoggerFactory is called inside MyClass.java a warning message telling me
that 2 bindings are available (ClassLoader.getResources(name) call):

1 - from logback
2 - from simple

But of course when slf4j API instantiates StaticLoggerBinder.getSingleton(),
the ChildFirstClassLoader will load simple's implementation, which in fact
is the unique implementation available for MyClass.java because logback is
hidden by the ChildFirstClassLoader.

Just thinking out loud:
Could it be possible to identify what classLoader is used to load the resource
(really not sure if this is possible), and do not warn if there is a single
binding available for the current API ?

Hope this is useful somehow, thanks 
tonio

-- 
Configure bugmail: http://bugzilla.slf4j.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the slf4j-dev mailing list