<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<property name="log.info.location" value="/export/Logs/xxx-app"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder charset="UTF-8">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} traceId=%X{trace-id}, parentId=%X{parent-id} spanId=%X{span-id} - %msg%n</pattern>
</encoder>
</appender>
<appender name="APP_ERROR"
class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${log.info.location}/app_error.log</file>
<append>true</append>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.info.location}/app_error.%d{yyyy-MM-dd}.%i.log
</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<maxHistory>100</maxHistory>
</rollingPolicy>
<encoder charset="UTF-8">
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{80} - %msg%n</pattern>
</encoder>
</appender>
<appender name="ASYNC_CONSOLE" class="ch.qos.logback.classic.AsyncAppender">
<queueSize>1024</queueSize>
<discardingThreshold>0</discardingThreshold>
<includeCallerData>false</includeCallerData>
<neverBlock>true</neverBlock>
<appender-ref ref="CONSOLE"/>
</appender>
<logger name="com.xxx.xxx" level="INFO" additivity="false">
<appender-ref ref="ASYNC_CONSOLE"/>
<appender-ref ref="APP_ERROR"/>
</logger>
<root level="INFO">
<appender-ref ref="ASYNC_CONSOLE"/>
</root>
</configuration>