However, there is still a problem if you're writing a Maven2 based application: even if you're using SLF4J, you will probably end up with a viral JCL jar in your classpath!
That's because JCL is still used by a lot of projects, and Maven places it in your classpath as a transitive dependency.
Fortunately enough, there's still a way to completely, and easily, get rid of it thanks to the jcl-over-slf4j module, and a little Maven trick.
Here's the receipt:
Add the following SLF4J dependencies:
- logback-classic (or your SLF4J implementation of choice).
Configure the JCL dependency with scope provided.
So here's how your Maven dependencies should look like:
By doing so, JCL will not be included in your classpath (because Maven considers it to be externally provided), while under the hood will be implemented by SLF4J thanks to the jcl-over-slf4j module.
That's all, folks.
Now you have one, and only one, safe logging library!