<?xml version="1.0" encoding="UTF-8"?>
demo
[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %-5level %logger{80} %method %line - %msg%n
<!-- 输出到文件 -->
<appender name="fileLog" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOGPATH}${file.separator}demo.log</file>
<append>true</append>
<encoder>
<pattern>
[%date{yyyy-MM-dd HH:mm:ss.SSS}] %X{logthreadId} %-5level %logger{80} %method %line - %msg%n
</pattern>
</encoder>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<fileNamePattern>${LOGPATH}${file.separator}%d{yyyy-MM-dd}${file.separator}%d{yyyy-MM-dd}.%i.log.zip</fileNamePattern>
<maxHistory>7</maxHistory>
<maxFileSize>10MB</maxFileSize>
</rollingPolicy>
</appender>
<root level="INFO">
<appender-ref ref="fileLog" />
<appender-ref ref="stdout" />
</root>