Skip to content

Instantly share code, notes, and snippets.

@satendrakumar
Last active April 15, 2017 05:42
Show Gist options
  • Save satendrakumar/d51fe8b854b86f2041f2ea4fda765b45 to your computer and use it in GitHub Desktop.
Save satendrakumar/d51fe8b854b86f2041f2ea4fda765b45 to your computer and use it in GitHub Desktop.
logback xml with rolling appender
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%highlight([%level]) - [%thread] - [%date] - [%logger] %msg%n</pattern>
</encoder>
</appender>
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<prudent>true</prudent>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>logs/etl-%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<append>true</append>
<encoder>
<pattern>%highlight([%level]) - [%date] - [%logger] %msg%n</pattern>
</encoder>
</appender>
<logger name="com.techmonad" level="info">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="FILE"/>
</logger>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment