## **slf4j 说明**
简单日志门面,对应的英文为Simple Logging Facade,是存取日志的标准接口,包括slf4j、log4j、jdk logging api和apache common-log等具体实现。
[SLF4J](https://www.slf4j.org/)
## **入门**
maven
~~~
<!--slf4j 日志门面 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
</dependency>
<!--slf4j 简单实现 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version>
</dependency>
~~~
代码
~~~
package cn.maicaii;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class App {
protected static Logger logger =LoggerFactory.getLogger(App.class);
@Test
public void main() {
logger.info("admmin");
}
}
~~~
实现原理
![](https://img.kancloud.cn/b4/dc/b4dcef2e4a6d60767e3620be92ccd752_1152x636.png)