SpringBoot默认日志配置
1、编写一个junit测试类,用来打印springboot日志。package com.gwolf;import org.junit.Test;import org.junit.runner.RunWith;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.test.context.SpringBootTest;import org.springframework.test.context.junit4.SpringRunner;@RunWith(SpringRunner.class)@SpringBootTestpublic class SpringBoot01HelloQuickApplicationTests { Logger logger = LoggerFactory.getLogger(this.getClass()); @Test public void contextLoads() { this.logger.trace("这个trace日志..."); this.logger.debug("这个debug日志..."); this.logger.info("这个info日志..."); this.logger.warn("这个warn日志..."); this.logger.error("这个error日志..."); }}

3、修改application.properties日志级别。server.port=8081logging.level.com.gwolf=trace

5、可以通过指定logging.path在当前磁盘的根路径下创建spring文件夹和里面的log文件夹。logging.path=/spring/log
