当前位置:   article > 正文

logback配置踩坑记录_could not find an appender named [console]. did yo

could not find an appender named [console]. did you define it below instead

报错: Could not find an appender named [DB]. Did you define it below instead of above in the configuration file?

看意思是 找不到 名为DB的appender标签 ,但实际是有的。
原因是 root 标签在上边 而 关联的appender 在下边 。appender标签放到 上边即可

原因是  root 标签在上边  而 关联的appender 在下边  。appender标签放到 上边即可

<root level="INFO">
        <appender-ref ref="DB" />
</root>
<appender name="DB" class="ch.qos.logback.classic.db.DBAppender"> ***</appender>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

贴俩个相关配置文件链接
logback配置内容 : https://github.com/qos-ch/logback/blob/master/logback-examples/src/main/resources/chapters/appenders/db/append-toMySQL-with-driverManager.xml
logback 建表语句 :https://github.com/qos-ch/logback/blob/master/logback-classic/src/main/resources/ch/qos/logback/classic/db/script/mysql.sql

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/312760
推荐阅读
相关标签
  

闽ICP备14008679号