log4j是Apache的一个开源项目,陪伴了我们多年,但是现在已经不更新了。官网原文如下:
Log4j 1.x has been widely adopted and used in many applications. However, through the years development on it has slowed down. It has become more difficult to maintain due to its need to be compliant with very old versions of Java and became End of Life in August 2015. Its alternative, SLF4J/Logback made many needed improvements to the framework. So why bother with Log4j 2? Here are a few of the reasons.
一、log4j简介
1、log4j支持.properties或xml这两种文件类型的配置文件。
2、log4j只需要引入一个jar包即可:
<dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version></dependency>
3、.properties配置文件属性