<?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/${spring.application.name:-application}.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>/home/quant_group/logs/${spring.application.name:-application}.log.%d{yyyy-MM-dd}
            </fileNamePattern>
            <maxHistory>30</maxHistory>
        </rollingPolicy>
        <encoder>
            <pattern>${FILE_LOG_PATTERN}</pattern>
        </encoder>
    </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"/>
    </root>

</configuration>