[slf4j-dev] Failing fast when multiple implementations of slf4j on the classpath?

Ceki Gulcu ceki at qos.ch
Wed May 13 20:39:08 CEST 2009


The getResources(String) method in ClassLoader class would furnish a solution 
provided that each slf4j binding included a resource file, say slf4j_marker.txt. 
For actual coide see the multiplicityWarning method in ContextInitializer.java 
[1]. Thus, multiple occurrences of newer versions of slf4j bindings could be 
detected, which is less than ideal.

[1] http://tinyurl.com/q7xh8m


Ceki Gulcu wrote:
> 
> It's a great idea. How would you go about implementing it?
> 
> Robert Elliot wrote:
>> I haven't had a look at the code yet, but a question on the logback 
>> user list made me wonder whether it might not be a good idea for SLF4J 
>> to fail fast with an informative error message if multiple SLF4J 
>> implementations are on the classpath.   I'll have a look at it if Ceki 
>> thinks it's a good idea, but I wanted to ask first so as not to waste 
>> time if its already been considered and rejected as an idea.  It may 
>> be that it's simply not possible to do this?
> 

-- 
Ceki Gülcü
Logback: The reliable, generic, fast and flexible logging framework for Java.
http://logback.qos.ch



More information about the slf4j-dev mailing list