<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property name="LOG_PATH" value="/logs/interview" />
    <property name="LOG_FILE_NAME" value="interview" />

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

    <appender name="LOGFILE-DEBUG" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>DEBUG</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <File>${LOG_PATH}/${LOG_FILE_NAME}-debug.log</File>
        <rollingPolicy
                class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

            <FileNamePattern>${LOG_PATH}/${LOG_FILE_NAME}_debug_%d{yyyy-MM-dd}.log.%d{yyyy-MM-dd}</FileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %p %C %t, - %msg%n</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>

    <appender name="LOGFILE-INFO" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>INFO</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <File>${LOG_PATH}/${LOG_FILE_NAME}-info.log</File>
        <rollingPolicy
                class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${LOG_PATH}/${LOG_FILE_NAME}_info_%d{yyyy-MM-dd}.log.%d{yyyy-MM-dd}</FileNamePattern>

        </rollingPolicy>
        <encoder>
            <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %p %C %t, - %msg%n</pattern>
            <charset>UTF-8</charset>
        </encoder>
    </appender>

    <appender name="LOGFILE-ERROR" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <filter class="ch.qos.logback.classic.filter.LevelFilter">
            <level>ERROR</level>
            <onMatch>ACCEPT</onMatch>
            <onMismatch>DENY</onMismatch>
        </filter>
        <File>${LOG_PATH}/${LOG_FILE_NAME}-error.log</File>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <FileNamePattern>${LOG_PATH}/${LOG_FILE_NAME}_error_%d{yyyy-MM-dd}.%d{yyyy-MM-dd}</FileNamePattern>
        </rollingPolicy>
        <encoder>
            <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %p %C %t, - %msg%n</pattern>
            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
        </encoder>
        <!--<layout class="ch.qos.logback.classic.PatternLayout">
            <pattern>[%date{yyyy-MM-dd HH:mm:ss.SSS}] [%thread] %p %C %t, - %msg%n</pattern>
        </layout>-->
    </appender>

    
    <logger name="com.crossoverjie">
        <level value="INFO" />
        <appender-ref ref="LOGFILE-INFO"/>
    </logger>


    <root level="INFO">
        <appender-ref ref="LOGFILE-DEBUG" />
        <appender-ref ref="LOGFILE-INFO" />
        <appender-ref ref="LOGFILE-ERROR" />
        <appender-ref ref="CONSOLE" />
    </root>


</configuration>