mons.base.1.1.0-rc2.source-code.logback-test.xml Maven / Gradle / Ivy
The newest version!
<?xml version="1.0" encoding="UTF-8"?> <configuration> <!-- 控制台输出 --> <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender"> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>%d{"yyyy-MM-dd HH:mm:ss,SSS"} [%p] [%t] [%F:%L] %msg%n</pattern> </encoder> </appender> <!-- 输出日志到文件 --> <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <append>true</append> <!-- 按照每天生成日志文件 --> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <!--日志文件输出的文件名--> <fileNamePattern>${logPath}-%d{yyyy-MM-dd}.log</fileNamePattern> <!--日志文件保留天数--> <maxHistory>15</maxHistory> </rollingPolicy> <!--日志文件最大的大小--> <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> <MaxFileSize>100MB</MaxFileSize> </triggeringPolicy> <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"> <pattern>%d{"yyyy-MM-dd HH:mm:ss,SSS"} [%p] [%t] [%F:%L] %msg%n</pattern> </encoder> </appender> <!-- 日志输出级别 --> <root level="INFO"> <appender-ref ref="STDOUT"/> <appender-ref ref="FILE"/> </root> </configuration>