<?xml version="1.0" encoding="UTF-8"?>
<Configuration debug="false" scan="false" scanPeriod="90 seconds">

    <Properties>
        <Property name="BASE_DIR" value="logs"/>
        <Property name="CHARSET" value="utf-8"/>
        <Property name="PATTERN_LAYOUT" value="===================================================================%n%-5level | %d{yyyy-MM-dd HH:mm:ss.SSSS} | %X{REQUEST_CONTEXT} | %thread%n%msg%n"/>
    </Properties>

    <Appenders>
        <RollingFile name="rollingFile-info"
                     createOnDemand="true"
                     immediateFlush="true"
                     filePattern="${BASE_DIR}/info_%d{yyyy-MM-dd}.log"
        >
            <PatternLayout pattern="${PATTERN_LAYOUT}" charset="${CHARSET}"/>
            <TimeBasedTriggeringPolicy/>
        </RollingFile>

        <RollingFile name="rollingFile-debug"
                     createOnDemand="true"
                     immediateFlush="true"
                     filePattern="${BASE_DIR}/debug_%d{yyyy-MM-dd}.log"
        >
            <PatternLayout pattern="${PATTERN_LAYOUT}" charset="${CHARSET}"/>
            <TimeBasedTriggeringPolicy/>
        </RollingFile>

        <RollingFile name="rollingFile-error"
                     createOnDemand="true"
                     immediateFlush="true"
                     filePattern="${BASE_DIR}/error_%d{yyyy-MM-dd}.log"
        >
            <PatternLayout pattern="${PATTERN_LAYOUT}" charset="${CHARSET}"/>
            <TimeBasedTriggeringPolicy/>
        </RollingFile>

        <RollingFile name="rollingFile-warn"
                     createOnDemand="true"
                     immediateFlush="true"
                     filePattern="${BASE_DIR}/warn_%d{yyyy-MM-dd}.log"
        >
            <PatternLayout pattern="${PATTERN_LAYOUT}" charset="${CHARSET}"/>
            <TimeBasedTriggeringPolicy/>
        </RollingFile>

        <RollingFile name="rollingFile-trace"
                     createOnDemand="true"
                     immediateFlush="true"
                     filePattern="${BASE_DIR}/trace_%d{yyyy-MM-dd}.log"
        >
            <PatternLayout pattern="${PATTERN_LAYOUT}" charset="${CHARSET}"/>
            <TimeBasedTriggeringPolicy/>
        </RollingFile>
    </Appenders>

    <Loggers>
        <Logger name="INFO" level="info" additivity="false">
            <AppenderRef ref="rollingFile-info"/>
        </Logger>

        <Logger name="DEBUG" level="debug" additivity="false">
            <AppenderRef ref="rollingFile-debug"/>
        </Logger>

        <Logger name="ERROR" level="error" additivity="false">
            <AppenderRef ref="rollingFile-error"/>
        </Logger>

        <Logger name="WARN" level="warn" additivity="false">
            <AppenderRef ref="rollingFile-warn"/>
        </Logger>

        <Logger name="TRACE" level="trace" additivity="false">
            <AppenderRef ref="rollingFile-trace"/>
        </Logger>
    </Loggers>

</Configuration>