标题: spring中怎么使用slf4j [打印本页] 作者: SOAR 时间: 2013-5-16 12:58 标题: spring中怎么使用slf4j 这几天在学spring,看到它的文档上关于日志那一节是这样说的。
Not Using Commons Logging
Unfortunately, the runtime discovery algorithm in commons-logging, while convenient for the enduser,
is problematic. If we could turn back the clock and start Spring now as a new project it would use
a different logging dependency. The first choice would probably be the Simple Logging Facade for Java
(SLF4J), which is also used by a lot of other tools that people use with Spring inside their applications.
Switching off commons-logging is easy: just make sure it isn't on the classpath at runtime. In Maven
terms you exclude the dependency, and because of the way that the Spring dependencies are declared,you only have to do that once.