springboot项目创建教程 https://blog.youkuaiyun.com/q18771811872/article/details/88126835 配置soringboot日志打印,架包springboot框架自带
代码如下
#日志打印
logging:
level:
com:
example: DEBUG
file: demo/log/springboot.log # file属性可以自定义日志文件名字 默认名字spring.log
file.max-size: 10MB #设置大小 默认10MB ,超过大小会按日期自动打包成压缩文件
file.max-history: 0
path: demo/log/ #日志文件路径 path优先级小于file
pattern:
dateformat: yyyy-MM-dd HH:mm:ss.SSS # 日志时间前缀 默认格式yyyy-MM-dd HH:mm:ss.SSS
debug: true #打印自动配置信息
效果图,我这里把大小设置为1K。然后回看到自动打包成很多个压缩包
源码地址 前几篇演示的都在里面 https://gitee.com/wcccccccc/demo
springboot项目创建教程 https://blog.youkuaiyun.com/q18771811872/article/details/88126835