Through the above diagram, you can simply clarify the relationship!
Commons-logging and SLF4J are log interfaces for use by users, without providing implementations!
Log4j,logback and so on is the real implementation of the log.
When we invoke an interface, the factory of the interface automatically finds the appropriate implementation, returning an instance of the implementation to the service. These processes are transparent and users do not need to do anything!
Here's a little story, when Apache persuaded Log4j and other logs to be written according to commons-logging standards, but because of commons-logging class loading a bit of a problem, the implementation is not friendly, so log4j author created slf4j , and thus with the commons-logging two points of the world. As for which to use, it is up to the user to decide.
In this way, SLF4J appears, it can find the implementation of its own interface by simple implementation class, if not meet their own standards of the log, can be achieved through some intermediate implementations such as the above Slf4j-log4j12.jar to adapt.
Article excerpt from http://www.cnblogs.com/xing901022/p/4149524.html
Slf4j,commons-logging,log4j and so on the relationship of log jar