add: 启动日志

This commit is contained in:
xiongxiaoyang
2022-04-26 09:15:24 +08:00
parent 906e7762c9
commit 7395cf63e5
5 changed files with 50 additions and 3 deletions

View File

@ -36,3 +36,7 @@ mybatis:
typeAliasesPackage: com.java2nb.**.domain
#[弃用]配置缓存和session存储方式默认ehcache,可选redis,[弃用]调整至 spring cache typeshiro.用户权限sessionspring.cache通用
#[弃用]cacheType: ehcache
logging:
config: classpath:logback-boot.xml

View File

@ -24,7 +24,7 @@
<!-- RollingFileAppender滚动记录文件先将日志记录到指定文件当符合某个条件时将日志记录到其他文件 -->
<!-- 以下的大概意思是1.先按日期存日志日期变了将前一天的日志文件名重命名为XXX%日期%索引新的日志仍然是demo.log -->
<!-- 2.如果日期没有发生变化但是当前日志的文件大小超过1KB时对当前日志进行分割 重命名 -->
<appender name="debug" class="ch.qos.logback.core.rolling.RollingFileAppender">
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>logs/debug.log</File>
<!-- rollingPolicy:当发生滚动时决定 RollingFileAppender 的行为涉及文件移动和重命名 -->
@ -52,11 +52,13 @@
<!-- 控制台输出日志级别 -->
<root level="INFO">
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</root>
<!-- 指定项目中某个包当有日志操作行为时的日志记录级别 -->
<!-- com.maijinjie.springboot 为根包也就是只要是发生在这个根包下面的所有日志操作行为的权限都是DEBUG -->
<!-- 级别依次为从高到低FATAL > ERROR > WARN > INFO > DEBUG > TRACE -->
<logger name="com.java2nb" level="DEBUG" additivity="false">
<appender-ref ref="debug" />
<appender-ref ref="STDOUT" />
<appender-ref ref="FILE" />
</logger>
</configuration>