<?xml version="1.0" encoding="UTF-8"?>

<configuration scan="true">

    <contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
        <resetJUL>true</resetJUL>
    </contextListener>

    <appender name="ROLLINGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${logging.dir}/${project.name}/${project.name}.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${logging.dir}/${project.name}/${project.name}.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>90</maxHistory>
        </rollingPolicy>
        <encoder>
            <charset>utf-8</charset>
            <Pattern>[%d{yyyy-MM-dd HH:mm:ss.SSS}][%p][%X{sessionId}][%X{traceId}][${spring.profiles.active}][%X{userId}][%t|%logger{1.}|%M|%X{ctime}] - %msg %ex{full}%n</Pattern>
        </encoder>
    </appender>
    <appender name="ASYNC_ROLLINGFILE" class="ch.qos.logback.classic.AsyncAppender">
        <queueSize>512</queueSize>
        <appender-ref ref="ROLLINGFILE"/>
    </appender>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%-4relative [%thread] %-5level %logger{35} - %msg %ex{full}%n</pattern>
        </encoder>
    </appender>

    <logger name="cn.quant.andy" level="INFO"/>
    <logger name="javax.activation" level="ERROR"/>
    <logger name="org.quartz.core" level="ERROR"/>
    <logger name="org.quartz.simpl" level="ERROR"/>
    <logger name="com.zaxxer.hikari.pool" level="ERROR"/>
    <logger name="com.alibaba.dubbo.common.extension" level="ERROR"/>
    <logger name="org.apache.zookeeper" level="ERROR"/>
    <logger name="org.apache.curator" level="ERROR"/>
    <logger name="org.apache.catalina.loader" level="ERROR"/>
    <logger name="org.apache.catalina.util" level="ERROR"/>    <logger name="org.apache.catalina.core" level="ERROR"/>
    <logger name="org.hibernate.hql" level="ERROR"/>
    <logger name="org.hibernate.loader" level="ERROR"/>
    <logger name="org.hibernate.type" level="ERROR"/>
    <logger name="org.hibernate.persister" level="ERROR"/>
    <logger name="org.hibernate.cfg" level="ERROR"/>
    <logger name="org.hibernate.mapping" level="ERROR"/>
    <logger name="org.hibernate.jpa.event" level="ERROR"/>
    <logger name="org.hibernate.validator.internal" level="ERROR"/>
    <logger name="org.hibernate.engine.internal" level="ERROR"/>
    <logger name="org.hibernate.boot.model" level="ERROR"/>
    <logger name="org.hibernate.boot.internal" level="ERROR"/>
    <logger name="org.apache.tomcat.util" level="ERROR"/>
    <logger name="org.springframework.orm" level="ERROR"/>
    <logger name="org.springframework.jmx" level="ERROR"/>
    <logger name="org.springframework.jndi" level="ERROR"/>
    <logger name="org.springframework.aop" level="ERROR"/>
    <logger name="org.springframework.web" level="ERROR"/>
    <logger name="org.springframework.context" level="ERROR"/>
    <logger name="org.springframework.core" level="ERROR"/>
    <logger name="org.springframework.beans" level="ERROR"/>
    <logger name="org.springframework.boot.web" level="ERROR"/>
    <logger name="org.springframework.boot.actuate" level="ERROR"/>
    <logger name="org.springframework.boot.context" level="ERROR"/>
    <logger name="org.springframework.boot.autoconfigure.logging" level="ERROR"/>
    <logger name="org.springframework.cloud.task" level="ERROR"/>

    <root level="INFO">
        <appender-ref ref="STDOUT"/>
        <appender-ref ref="ASYNC_ROLLINGFILE"/>
    </root>

</configuration>