I want to use SLF4J for logging instead of commons-logging. How do I configure?
I want to use SLF4J for logging instead of commons-logging. How do I configure?
No way. Commons-logging is the only Spring hard dependency.
To be more precious you may use SLF4J in your own code, but you still need commons-logging for Spring itself.
There is a way.
You could always update the Spring source and recompile.
With global search and replace this wouldn't be such a big deal.
Just use the SLF4J jcl104-over-slf4j jar as a drop-in replacement for the commons-logging jar. With this you can get all the benefits of SLF4J and still use the exact same commons-logging API - ie no changes in your code.
If you use Maven, the dependency is as follows:
AlanCode:<dependency> <groupId>org.slf4j</groupId> <artifactId>jcl104-over-slf4j</artifactId> <version>1.4.2</version> </dependency>