1.引入Spring框架(內含slf4j)
<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.0.RELEASE</version> <relativePath/> </parent>
2.代碼引入
private Logger logger = LoggerFactory.getLogger(this.getClass());
3.常用方法
trace(String msg);
debug(String msg);
info(String msg);
warn(String msg);
error(String msg);