1. 1. Log System)
Log4j --Log4j is the log system that appears successfully earlier. The log system model (logger/appender/level) created by log4j is effective and has been used for a long time.
Jul(Java. util. Logging .*)-- Jdk1.4 is the first JDK with its own log system (Jul ). Jul does not have any obvious advantages to defeat log4j. Instead, it creates standard chaos-applications using different log systems cannot coexist harmoniously.
Logback-- Is a newer log system. It is a new system developed by log4j authors after years of experience. It is more convenient to use, has stronger functions, and has higher performance. Logback cannot be used independently. It must be used with the log framework slf4j.
1. 2. Log framework)
After Jul was born, a "log framework" emerged to overcome the confusions brought about by the coexistence of multiple log systems ". The log framework itself does not provide the logging function. It only provides the APIS called by logs. The log Framework relies on actual log systems such as log4j or Jul to generate real logs.
The advantage of using the log framework is that the application deployer can decide which log system (log4j or Jul) to use or switch between multiple log systems, you do not need to change the application code.
Jcl(Jakarta commons Logging)-- This is currently the most popular log framework, provided by the Apache Jakarta community. Both the Spring framework and webx2 framework depend on jcl.
Slf4j-- This is the latest log framework launched by the author of log4j. Slf4j provides new APIs, especially used with the new functions of logback. Slf4j is also compatible with log4j. This framework is used to replace the jcl framework.
1.3.SLF4J
Slf4j (simple logging facade for Java) is a general log framework. It cannot be called a facade. The role played is equivalent to Jakarta commons logging.
Two application modes of slf4j: slf4j + log4j and slf4j + logback
Specific use, refer to: http://cammsia.javaeye.com/blog/645080