Last active
August 29, 2015 14:09
-
-
Save BenWhitehead/6018b052e44c2c68d2ec to your computer and use it in GitHub Desktop.
Logback configuration for rolling file appender
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<configuration scan="true" scanPeriod="30 seconds"> | |
<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator"> | |
<resetJUL>true</resetJUL> | |
</contextListener> | |
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | |
<file>app.log</file> | |
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy"> | |
<fileNamePattern>app.log.%i.zip</fileNamePattern> | |
<minIndex>1</minIndex> | |
<maxIndex>10</maxIndex> | |
</rollingPolicy> | |
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy"> | |
<maxFileSize>10MB</maxFileSize> | |
</triggeringPolicy> | |
<encoder> | |
<pattern>%d{HH:mm:ss.SSS} %-5level [%thread] %logger{36} - %msg%n</pattern> | |
</encoder> | |
</appender> | |
<root level="info"> | |
<appender-ref ref="FILE"/> | |
</root> | |
</configuration> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment