1.引入依赖
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>2.0.0-alpha6</version>
</dependency>
2. 注入变量
private Logger logger = LoggerFactory.getLogger(this.getClass());
3.注入后会自动导包
import org.slf4j.Logger; import org.slf4j.LoggerFactory;
4.直接变量名. 就可以进行日志打印了
5.打印成功