<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">
<!-- 只需配置好 log.dir 和 appName 属性 -->
<property name="log.dir" value="/alidata1/admin/prophet-za-metadata"/>
<property name="projectname" value="prophetMetadata"/>
<!-- 引入调用链配置 -->
<include resource="trace.xml"/>
<appender name="infoAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>{log.dir}/logs/{HOSTNAME}-ss_micro_app_${projectname}_lt_info.log</file>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>info</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>{log.dir}/logs/{HOSTNAME}-ss_micro_app_${projectname}lt_info%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder charset="UTF-8" class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${TRACE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<appender name="errorAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>{log.dir}/logs/{HOSTNAME}-ss_micro_app_${projectname}_lt_error.log</file>
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>warn</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>{log.dir}/logs/{HOSTNAME}-ss_micro_app_${projectname}lt_error%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory>
</rollingPolicy>
<encoder charset="UTF-8" class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
<pattern>${TRACE_LOG_PATTERN}</pattern>
</encoder>
</appender>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<target>System.out</target>
<encoder charset="UTF-8">
<pattern>%d [%thread] %-5p [%c] - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.springframework">
<level value="INFO"/>
<appender-ref ref="STDOUT"/>
</logger>
<root>
<level value="INFO" />
<appender-ref ref="infoAppender"/>
<appender-ref ref="errorAppender"/>
</root>
</configuration>