Skip to content

Instantly share code, notes, and snippets.

@arjones
Created June 15, 2016 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arjones/bc2134e589a3088c585d861182c2b00e to your computer and use it in GitHub Desktop.
Save arjones/bc2134e589a3088c585d861182c2b00e to your computer and use it in GitHub Desktop.
Logback sample configuration with RollingFileAppender
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--Daily rolling file appender -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<File>logs/application.log</File>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<FileNamePattern>logs/application.%d{yyyy-MM-dd}.log.gz</FileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg%n</Pattern>
</layout>
</appender>
<logger name="com.smx"><level value="INFO"/></logger>
<logger name="edu.uci.ics.crawler4j"><level value="WARN"/></logger>
<logger name="org.apache.http.impl.conn.PoolingClientConnectionManager"><level value="WARN" /></logger>
<root>
<level value="INFO"/>
<appender-ref ref="FILE"/>
</root>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment