<?xml version="1.0" encoding="UTF-8"?>
<!--
  Example LOGBACK Configuration File
  http://logback.qos.ch/manual/configuration.html
  -->
<configuration  scan="true" scanPeriod="30 seconds">
    <property name="log_base" value="${log_base}"/>

    <appender name="console" class="ch.qos.logback.core.ConsoleAppender">
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} {%thread} %-5level %logger{50} - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="stdout" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${log_base}/stdout.log</file>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} {%thread} %-5level %logger{50} - %msg%n</pattern>
        </encoder>

        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>${log.level}</level>
        </filter>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${log_base}/otherdays/stdout.%d{yyyy-MM-dd}.log</FileNamePattern>
            <MaxHistory>30</MaxHistory>
        </rollingPolicy>
    </appender>

    <appender name="stderr" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${log_base}/stderr.log</file>
        <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} {%thread} %-5level %logger{50} - %msg%n</pattern>
        </encoder>

        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>ERROR</level>
        </filter>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${log_base}/otherdays/stderr.%d{yyyy-MM-dd}.log</FileNamePattern>
            <MaxHistory>30</MaxHistory>
        </rollingPolicy>
    </appender>
    
    
    <appender name="managerAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${log_base}/manager/cachecloud_manager.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${log_base}/manager/cachecloud_manager.log.%d{yyyyMMddHH}
            </fileNamePattern>
            <maxHistory>365</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <!--<logger name="org.cache.dao" level="DEBUG">-->
        <!--<appender-ref ref="console"/>-->
    <!--</logger>-->

    <root level="${log.level}">
        <appender-ref ref="console"/>
        <appender-ref ref="stdout"/>
        <appender-ref ref="stderr"/>
    </root>

    <logger name="com.sohu.cache.web.controller.AppManageController" level="WARN">
        <appender-ref ref="managerAppender"/>
    </logger>
    
    <logger name="com.sohu.cache.web.controller.InstanceManageController" level="WARN">
        <appender-ref ref="managerAppender"/>
    </logger>

</configuration>