logback: [编码器] 没有适用的操作,当前 ElementPath 是 [[配置][追加器][编码器]]
我写了一个用于日志备份的追加器,并将日志保存到ElasticSearch中,然后将此追加器添加到logback.xml。我将其应用于一个应用程序,并从ES获取了日志。
但是当我将其应用于另一个应用程序时,logback显示以下错误:
16:18:26,040 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [com.dcf.iqunxing.fx.dashcam.agent.log.appender.logback.DashcamAppender]
16:18:26,062 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [dashcamAppender]
16:18:26,078 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@110:12 - no applicable action for [encoder], current ElementPath is [[configuration][appender][encoder]]
16:18:26,080 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@111:13 - no applicable action for [Pattern], current ElementPath is [[configuration][appender][encoder][Pattern]]
我的日志.xml是:
...
<appender name="dashcamAppender"
class="com.dcf.iqunxing.fx.dashcam.agent.log.appender.logback.DashcamAppender">
<encoder>
<Pattern>.%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</Pattern>
</encoder>
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>TRACE</level>
</filter>
</appender>
...
丢失了一些操作(或如何添加它们)进行日志备份?