Skip to content

Instantly share code, notes, and snippets.

@dsdstudio
Created January 25, 2016 02:17
Show Gist options
  • Save dsdstudio/aee51d232d2406ee0cba to your computer and use it in GitHub Desktop.
Save dsdstudio/aee51d232d2406ee0cba to your computer and use it in GitHub Desktop.
logback rollingfileappender + gzip compression
<?xml version="1.0" encoding="UTF-8"?>
<!-- debug=true 해주는이유는 설정이 잘못되었는지 미리 판단이 가능하기 때문이다 -->
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>
%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n
</Pattern>
</layout>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>/var/log/tomcat7/app.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>app.%d{yyyy-MM-dd}.log.gz</fileNamePattern>
<maxHistory>90</maxHistory>
</rollingPolicy>
<encoder>
<Pattern>
%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
</Pattern>
</encoder>
</appender>
<root level="info">
<appender-ref ref="STDOUT"/>
<appender-ref ref="FILE"/>
</root>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment