<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>logs/syslog-consumer-dm.log</file>
        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>logs/syslog-consumer-dm.%d{yyyy-MM-dd}.log</fileNamePattern>

            <!-- 保留的日志文件的最大天数 -->
            <maxHistory>1</maxHistory>
            <!-- 所有归档日志文件的总大小上限 -->
            <totalSizeCap>15GB</totalSizeCap>
            <!-- 启动时是否清理过期日志 -->
            <cleanHistoryOnStart>true</cleanHistoryOnStart>
        </rollingPolicy>
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>


    <root level="INFO">
        <appender-ref ref="CONSOLE" />
        <appender-ref ref="FILE" />
    </root>

    <logger name="com.influx" level="INFO" />
    <logger name="io.netty" level="WARN" />

    <!-- 专门屏蔽ProducerConfig的INFO日志 -->
    <logger name="org.apache.kafka.clients.producer.ProducerConfig" level="WARN"/>
    <!-- 或者更通用地，屏蔽整个Kafka客户端包的INFO日志 -->
    <logger name="org.apache.kafka.clients" level="WARN"/>
</configuration>