Skip to content

Instantly share code, notes, and snippets.

Created July 3, 2013 18:26
  • Star 34 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jcraane/5921329 to your computer and use it in GitHub Desktop.
Sample logback.xml file with console and rolling file appender. The rollover is time based (daily) and size based, 5MB.
<?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
<Pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- daily rollover. Make sure the path matches the one in the file element or else
the rollover logs are placed in the working directory. -->
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- keep 30 days' worth of history -->
<pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
<root level="DEBUG">
<appender-ref ref="consoleAppender" />
<appender-ref ref="FILE"/>
Copy link

haigopi commented Dec 14, 2015

Thank you.

Copy link

hensg commented Jul 3, 2016


Copy link

It's work for me. Thank you :)

Copy link


Copy link

Thank you !

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