<?xml version="1.0" encoding="UTF-8"?>
|
<configuration debug="false" scan="true" scanPeriod="1 seconds">
|
|
<contextName>logback</contextName>
|
<property name="log.path" value="./logs/dl-xxl-job-admin"/>
|
<property name="console.log.pattern"
|
value="%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{36}%n) - %msg%n"/>
|
<property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n"/>
|
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
<encoder>
|
<pattern>${console.log.pattern}</pattern>
|
<charset>utf-8</charset>
|
</encoder>
|
</appender>
|
|
<appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
<file>${log.path}.log</file>
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
<fileNamePattern>${log.path}.%d{yyyy-MM-dd}.log</fileNamePattern>
|
<!-- 日志最大的历史 60天 -->
|
<maxHistory>60</maxHistory>
|
</rollingPolicy>
|
<encoder>
|
<pattern>${log.pattern}</pattern>
|
</encoder>
|
</appender>
|
|
<root level="info">
|
<appender-ref ref="console"/>
|
<appender-ref ref="file"/>
|
</root>
|
|
</configuration>
|