Skip to content

Instantly share code, notes, and snippets.

@jebberjeb
Created January 12, 2017 22:05
Show Gist options
  • Save jebberjeb/24981a41fccd04652ca0c1a1c4c4ddaa to your computer and use it in GitHub Desktop.
Save jebberjeb/24981a41fccd04652ca0c1a1c4c4ddaa to your computer and use it in GitHub Desktop.
Logback appender used with Stuart Sierra's log.dev
<appender name="ALL_LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- Default encoder is ch.qos.logback.classic.encoder.PatternLayoutEncoder -->
<encoder>
<pattern>%date{HH:mm:ss.SSS} %-5level %logger{25}: %msg %X thread=%thread%n</pattern>
</encoder>
<!-- Default location of log file is log/all.log -->
<file>log/all.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.FixedWindowRollingPolicy">
<!-- Can't contain date stuff or won't roll over -->
<fileNamePattern>log/all.%i.log</fileNamePattern>
<!-- Only retain 5 * 64MB of log files -->
<minIndex>1</minIndex>
<maxIndex>5</maxIndex>
</rollingPolicy>
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
<maxFileSize>64MB</maxFileSize>
</triggeringPolicy>
</appender>
@jebberjeb
Copy link
Author

Used this after copy/paste'ing https://github.com/stuartsierra/log.dev logback.xml into a project for use in local dev env.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment