<?xml version="1.0" encoding="UTF-8" ?>
<!-- 日志配置 -->
<configuration>

    <springProperty name="spring.application.name" source="spring.application.name"/>
    <property name="LOG_LEVEL_PATTERN" value="%5p [${spring.application.name:-},%X{X-B3-TraceId:-},%X{X-B3-SpanId:-},%X{X-Span-Export:-}]"/>
    <property name="FILE_LOG_PATTERN"
              value="${FILE_LOG_PATTERN:-%d{yyyy-MM-dd HH:mm:ss.SSS} ${LOG_LEVEL_PATTERN:-%5p} --- [%thread] [%file:%line] %logger - %msg%n}"/>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>/home/quant_group/logs/qa-platform.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/home/quant_group/logs/qa-platform.log.%d{yyyy-MM-dd}</fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>${FILE_LOG_PATTERN}</pattern>
        </encoder>
    </appender>

    <appender name="Sentry" class="cn.quantgroup.sentry.appender.StandardSentryAppender">
        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>WARN</level>
            <!-- level:基本建议ERROR or WARN -->
        </filter>
    </appender>

    <logger name="org.springframework" level="warn"/>
    <logger name="org.hibernate" level="warn"/>
    <logger name="org.apache" level="warn"/>
    <logger name="ch.qos.logback" level="warn"/>

    <!--基础的日志输出-->
    <root level="INFO">
        <appender-ref ref="FILE"/>
        <appender-ref ref="Sentry"/>
    </root>
</configuration>