Skip to content

Instantly share code, notes, and snippets.

@semudu
Forked from jcraane/logback.xml
Last active August 29, 2015 14:11
Show Gist options
  • Select an option

  • Save semudu/cc01cc30b977ff87b820 to your computer and use it in GitHub Desktop.

Select an option

Save semudu/cc01cc30b977ff87b820 to your computer and use it in GitHub Desktop.

Revisions

  1. @jcraane jcraane revised this gist Jul 3, 2013. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion logback.xml
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@
    </appender>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/srv/logs//application.log</file>
    <file>/srv/logs/application.log</file>
    <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. -->
  2. @jcraane jcraane created this gist Jul 3, 2013.
    34 changes: 34 additions & 0 deletions logback.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration scan="true">
    <appender name="consoleAppender" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
    <charset>UTF-8</charset>
    <Pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</Pattern>
    </encoder>
    </appender>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/srv/logs//application.log</file>
    <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. -->
    <fileNamePattern>/srv/logs/application_%d{yyyy-MM-dd}.%i.log</fileNamePattern>

    <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
    <maxFileSize>5MB</maxFileSize>
    </timeBasedFileNamingAndTriggeringPolicy>
    <!-- keep 30 days' worth of history -->
    <maxHistory>30</maxHistory>
    </rollingPolicy>

    <encoder>
    <charset>UTF-8</charset>
    <pattern>%d %-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
    </encoder>
    </appender>

    <root level="DEBUG">
    <appender-ref ref="consoleAppender" />
    <appender-ref ref="FILE"/>
    </root>
    </configuration>