4 实战脚手架搭建-日志配置
spring boot默认使用logback作为日志系统,可以结合slf4j日志框架使用,springboot已经为当前使用的日志框架的控制台输出和文件输出做好了配置,
我们只需要在配置文件里加入以下配置即可。
4.1修改 application.properties
#logging配置
logging.file=${logging.path}/${spring.application.name}.log
logging.path=logs
logging.level.com.yingxue.lesson=debug
4.2修改 application.yml
#logging配置
logging:
file: ${logging.path}/${spring.application.name}.log
path: logs
level:
com.yingxue.lesson: debug
4.3 测试运行

网友评论