1.首先在pom.xml文件中增加依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j</artifactId>
</dependency>
2.在application.properties文件中增加log的配置
#log4j
logging.level.org.springframework.web=INFO
logging.level.org.hibernate=ERROR
logging.file=test.log
就可以开始输出信息了