Skip to content

Instantly share code, notes, and snippets.

@circlee
Created February 8, 2018 10:18
Show Gist options
  • Save circlee/fdd946460da0e7e600adbf8915462bd6 to your computer and use it in GitHub Desktop.
Save circlee/fdd946460da0e7e600adbf8915462bd6 to your computer and use it in GitHub Desktop.
<appender name="SIFT" class="ch.qos.logback.classic.sift.SiftingAppender">
<discriminator>
<key>fileName</key>
<defaultValue>mdc-file-appender</defaultValue>
</discriminator>
<sift>
<appender name="MDC_FILE_APPENDERE-${fileName}"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${LOG_PATH}/${fileName}.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${LOG_PATH}/${fileName}-%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>${LOG_PATTERN}</pattern>
</encoder>
</appender>
</sift>
</appender>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment