我想配置的是使用 CompositeJsonGeneratorDecorator (因为需要使用 net.logstash.logback.argument.StructuredArguments.kv 给日志追加输出 KV 项),按日输出日志的 appender,logback.xml 的配置如下会报错
<appender name="infoFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<jsonGeneratorDecorator class="net.logstash.logback.decorate.CompositeJsonGeneratorDecorator">
<decorator class="net.logstash.logback.decorate.PrettyPrintingJsonGeneratorDecorator"/>
</jsonGeneratorDecorator>
</encoder>
<!-- ThresholdFilter:临界值过滤器,过滤掉 TRACE 和 DEBUG 级别的日志 -->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${LOG_HOME}/log.%d{yyyy-MM-dd}.log</fileNamePattern>
<maxHistory>30</maxHistory><!--保存最近 30 天的日志-->
</rollingPolicy>
</appender>
烦请大家帮看一下,非常感谢~