Java log full analysis (top): https://zhuanlan.zhihu.com/p/24272450
Java log full analysis (bottom): https://zhuanlan.zhihu.com/p/24275518
1. Java logger Facade (Abstraction API ) introduce
JCL | Jakarta Commons Logging | 2002.08.13(v1.0.1) ~ 2014.07(v1.2) stable version |
SLF4J | The Simple Logger Facade for Java (founded by Ceki Gülcü) | 2005.05.04(v1.0-beta-2) ~ 2017.04.25(v1.8-alpha2) ~ Continuous update |
Log4J2 | Unlike Log4J, Log4j is a concrete implementation of log, while Log4J2 implements both Facade and Implement. | 2014.07.12(v2.0) ~ 2017.08.26(v2.9.0) ~ Continuous update |
2. Introduction to Java logger Implement
Log4J | Apache software Top Level, (founded by Ceki Gülcü) | 2005.01.08(v1.0) ~ 2012.05.06(v1.2.17), 2015.08.05 Log4J team announced to stop the update of Log4J1.0+ version. |
JUL | Java Util Log (official, but not popular) | since JDK 1.4(2002) |
SLF4J-Simple | Simple implementation of SLF4J. | 如:slf4j-simple-1.7.25.jar |
Logback | (founded by Ceki Gülcü) | 2006.07.26(v0.1) ~ 2017.03.30(v1.2.3) ~ Continuous update |
Log4J2 | Log4J2 is not compatible with Log4J. It was developed by the Log4J team and largely imitated SLF4J/Lockback in design. | Facade/Implement separation, such as log4j-api, log4j-core |
Currently popular combinations:
a: SLF4J + Logback: Both are projects founded by Ceki Gülcü. Logback supports SLF4J natively, which means that no additional Adapter/Bridge is required when the two are used together. Compared with the Log4j project first created by Ceki Gülcü, the Logback log implementation has greatly improved the performance, and also added features such as asynchronous Log, Filter, and Http access.
b: Log4J2: Developed by the Log4J team, both interfaces and implementations are available, and the performance is also great.
Performance test comparison on Log4J2 official website: http://logging.apache.org/log4j/2.x/performance.html
official website:
common logging: http://commons.apache.org/proper/commons-logging/
SLF4J: https://www.slf4j.org/
Log4J2: http://logging.apache.org/log4j/2.x/
Log4J: http://logging.apache.org/log4j/1.2/
Logback: https:// logback.qos.ch/