同学将自己的logback.xml复制粘贴出来一下,还有提供一下项目目录结构展开的截图呢~注意不要直接粘贴到回复中,会失去格式,可以粘贴在“我要回答”中,祝学习愉快~
2019-08-18 13:48:29
我也出现这个问题了。
日志可以在控制台输出,日志文件可以生成,但是日志信息无法写入生成的日志文件。
控制台日志显示Logback在解析配置文件的时候出现错误,一下是错误信息:
```log
15:20:31,770 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@62:22 - no applicable action for [encoder], current ElementPath is [[configuration][appender][rollingPolicy][encoder]]
15:20:31,770 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@64:26 - no applicable action for [pattern], current ElementPath is [[configuration][appender][rollingPolicy][encoder][pattern]]
15:20:31,770 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@67:71 - no applicable action for [filter], current ElementPath is [[configuration][appender][rollingPolicy][filter]]
15:20:31,771 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@69:24 - no applicable action for [level], current ElementPath is [[configuration][appender][rollingPolicy][filter][level]]
15:20:31,771 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@71:26 - no applicable action for [onMatch], current ElementPath is [[configuration][appender][rollingPolicy][filter][onMatch]]
15:20:31,771 |-ERROR in ch.qos.logback.core.joran.spi.Interpreter@73:30 - no applicable action for [onMissmatch], current ElementPath is [[configuration][appender][rollingPolicy][filter][onMissmatch]]
```
我在stack overflow(https://stackoverflow.com/questions/37022672/logback-no-applicable-action-for-encoder-current-elementpath-is-configurat)上查了一下,说是Logback无法解析<encoder>等标签。想要用的话要自己实现。。。
暂时还没有找到解决方法。
2019-09-05 16:16:27
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星