<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
    <Appenders>
        <!-- 控制台输出 -->
        <Console name="ConsoleAppender" target="SYSTEM_OUT">
            <PatternLayout pattern="%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%thread] (%F:%L) : %m%n%throwable"/>
        </Console>

        <!-- 动态路由日志文件 -->
        <Routing name="RoutingAppender">
            <Routes pattern="$${date:yyyy-MM-dd}">
                <Route>
                    <RollingFile name="Rolling-${date:yyyy-MM-dd}" fileName="logs/${date:yyyy-MM-dd}/system.log"
                                 filePattern="logs/%d{yyyy-MM-dd}/system-%i.log.gz">
                        <PatternLayout>
                            <pattern>%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} %-5p [%thread] (%F:%L) : %m%n%throwable</pattern>
                        </PatternLayout>
                        <Policies>
                            <TimeBasedTriggeringPolicy />
                            <SizeBasedTriggeringPolicy size="1024 MB"/>
                        </Policies>
                    </RollingFile>
                </Route>
            </Routes>
        </Routing>
    </Appenders>
    <Loggers>
        <!-- 屏蔽 org.apache.hc.client5 包下的所有日志 -->
        <Logger name="org.apache.hc.client5" level="OFF"/>
        <!-- 根日志记录器 -->
        <Root level="info">
            <AppenderRef ref="ConsoleAppender"/>
            <AppenderRef ref="RoutingAppender"/>
        </Root>
    </Loggers>
</Configuration>



