47 lines
2.0 KiB
XML
47 lines
2.0 KiB
XML
|
<?xml version="1.0" encoding="UTF-8"?>
|
|||
|
|
|||
|
<configuration>
|
|||
|
<!--定义日志文件的存储地址,使用绝对路径-->
|
|||
|
<property name="LOG_HOME" value="d:/logs"/>
|
|||
|
|
|||
|
<!-- Console 输出设置 -->
|
|||
|
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
|||
|
<encoder>
|
|||
|
<!--格式化输出:%d表示日期,%thread表示线程名,%-5level:级别从左显示5个字符宽度%msg:日志消息,%n是换行符-->
|
|||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|||
|
<charset>utf8</charset>
|
|||
|
</encoder>
|
|||
|
</appender>
|
|||
|
|
|||
|
<!-- 按照每天生成日志文件 -->
|
|||
|
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
|||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
|||
|
<!--日志文件输出的文件名-->
|
|||
|
<fileNamePattern>${LOG_HOME}/xc.%d{yyyy-MM-dd}.log</fileNamePattern>
|
|||
|
</rollingPolicy>
|
|||
|
<encoder>
|
|||
|
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
|||
|
</encoder>
|
|||
|
</appender>
|
|||
|
|
|||
|
<!-- 异步输出 -->
|
|||
|
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
|
|||
|
<!-- 不丢失日志.默认的,如果队列的80%已满,则会丢弃TRACT、DEBUG、INFO级别的日志 -->
|
|||
|
<discardingThreshold>0</discardingThreshold>
|
|||
|
<!-- 更改默认的队列的深度,该值会影响性能.默认值为256 -->
|
|||
|
<queueSize>512</queueSize>
|
|||
|
<!-- 添加附加的appender,最多只能添加一个 -->
|
|||
|
<appender-ref ref="FILE"/>
|
|||
|
</appender>
|
|||
|
|
|||
|
|
|||
|
<logger name="org.apache.ibatis.cache.decorators.LoggingCache" level="DEBUG" additivity="false">
|
|||
|
<appender-ref ref="CONSOLE"/>
|
|||
|
</logger>
|
|||
|
<logger name="org.springframework.boot" level="DEBUG"/>
|
|||
|
<root level="info">
|
|||
|
<!--<appender-ref ref="ASYNC"/>-->
|
|||
|
<appender-ref ref="FILE"/>
|
|||
|
<appender-ref ref="CONSOLE"/>
|
|||
|
</root>
|
|||
|
</configuration>
|