qos-ch/slf4j — pull request #66 by aeten (2014-03-15 22:59:34+00:00)
Title: Use of standard ServiceLoader

Hello,
I wrote a patch that use the standard ServiceLoader instead of conventional name classes StaticLoggerBinder, StaticMDCBinder and StaticMarkerBinder. This patch does not contains the test part (I have done my own test with simple, nop and jdk14 implementations).

The only thing to do is to declare implementations in META-INF/services directory. See the example below for simple implementation and basic marker and MDC:
# cat META-INF/services/org.slf4j.ILoggerFactory
org.slf4j.impl.SimpleLoggerFactory
# cat META-INF/services/org.slf4j.IMarkerFactory
org.slf4j.helpers.BasicMarkerFactory
# cat META-INF/services/org.slf4j.MDCAdapter
org.slf4j.helpers.BasicMDCAdapter

In this manner, several implementation may be in classpath. But most importantly, this avoids the tedious and inelegant multiple implementation of classes with conventional names.

Best regards,
Thomas Pérennou