<configuration scan="true" scanPeriod="10 seconds">
  <include resource="org/springframework/boot/logging/logback/base.xml"/>
  <property name="LOG_PATH" value="/data/logs/admin_log"/>
  <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="INFO_FILE">
    <File>${LOG_PATH}/admin_info.log</File>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>${LOG_PATH}/admin_info-%d{yyyyMMdd}_%i.log</fileNamePattern>
      <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
        <maxFileSize>100MB</maxFileSize>
      </timeBasedFileNamingAndTriggeringPolicy>
      <maxHistory>10</maxHistory>
    </rollingPolicy>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n</Pattern>
    </layout>
  </appender>

  <appender class="ch.qos.logback.core.rolling.RollingFileAppender" name="ERROR_FILE">
    <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
      <level>ERROR</level>
    </filter>
    <File>${LOG_PATH}/admin_error.log</File>
    <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>${LOG_PATH}/admin_error-%d{yyyyMMdd}_%i.log</fileNamePattern>
      <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
        <maxFileSize>100MB</maxFileSize>
      </timeBasedFileNamingAndTriggeringPolicy>
      <maxHistory>10</maxHistory>
    </rollingPolicy>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <Pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} -%msg%n</Pattern>
    </layout>
  </appender>
  <appender class="com.dianping.cat.logback.CatLogbackAppender" name="CatAppender"></appender>
  <root level="INFO">
    <appender-ref ref="INFO_FILE"/>
    <appender-ref ref="ERROR_FILE"/>
    <appender-ref ref="CatAppender"/>
  </root>

</configuration>
