Skip to content

Instantly share code, notes, and snippets.

@pwittchen
Forked from vazexqi/logback.xml
Created October 22, 2017 21:19
Show Gist options
  • Save pwittchen/f3a104f008a2233dd1ba4298c1531d87 to your computer and use it in GitHub Desktop.
Save pwittchen/f3a104f008a2233dd1ba4298c1531d87 to your computer and use it in GitHub Desktop.

Revisions

  1. @vazexqi vazexqi created this gist Feb 24, 2013.
    30 changes: 30 additions & 0 deletions logback.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    <configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
    <encoder>
    <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
    </appender>


    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
    <!-- Daily rollover -->
    <fileNamePattern>log/MyExample.%d{yyyy-MM-dd}.log</fileNamePattern>

    <!-- Keep 7 days' worth of history -->
    <maxHistory>7</maxHistory>
    </rollingPolicy>

    <encoder>
    <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
    </encoder>
    </appender>

    <!-- Configure so that it outputs to both console and log file -->
    <root level="DEBUG">
    <appender-ref ref="FILE" />
    <appender-ref ref="STDOUT" />
    </root>
    </configuration>