tl-core.2.1.1.source-code.logback.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <configuration debug="false" scan="true" scanPeriod="30 seconds"> <contextName>beetl-core</contextName> <substitutionProperty name="log.base" value="logs" /> <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender"> <withJansi>false</withJansi> <encoder charset="utf-8"> <pattern> [%level] %d{HH:mm:ss.SSS} [%thread] -%msg%n %caller{1} </pattern> </encoder> </appender> <appender name="logFile" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>${log.base}/log.log</file> <encoder charset="UTF-8"> <pattern>%d{HH:mm:ss.SSS} %msg%n</pattern> </encoder> <filter class="ch.qos.logback.classic.filter.ThresholdFilter"> <level>INFO</level> </filter> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!-- 按天回滚 --> <fileNamePattern> ${log.base}/log-%d{yyyy-MM-dd}.%i.log </fileNamePattern> <!-- 最多保留30天的记录 --> <maxHistory>30</maxHistory> <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> <!-- 最大文件150MB,超过150MB会生成多个文件,即后缀为%i.log形式 --> <maxFileSize>150MB</maxFileSize> </timeBasedFileNamingAndTriggeringPolicy> </rollingPolicy> </appender> <root level="DEBUG"> <appender-ref ref="stdout" /> <appender-ref ref="logFile" /> </root> <logger name="ch" level="WARN" /> <logger name="net" level="WARN" /> </configuration>