You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot升级后启动出现Logback配置错误问题排查

问题定位与解决

错误提示指向的是ElasticsearchAppender中BasicAuthentication相关的配置。

原因是你使用的logback-elasticsearch-appender版本与升级后的Spring Boot/Logback版本不兼容:当配置空的自闭合<authentication>标签(未添加username和password的<property>子元素)时,旧版本的appender会生成两个不符合Logback新版本校验规则的空<property>元素,触发了"必须单独设置'file'属性、单独设置'resource'元素,或同时设置'name'和'value'属性"的错误。

解决方式:

  • 若不需要Elasticsearch的Basic认证,直接删除整个<authentication>标签;
  • 若需要认证,补充完整的用户名和密码配置:
<authentication class="com.internetitem.logback.elasticsearch.config.BasicAuthentication">
    <property name="username" value="你的用户名"/>
    <property name="password" value="你的密码"/>
</authentication>
  • 建议同步升级logback-elasticsearch-appender到与当前Spring Boot/Logback版本兼容的最新版本,避免后续兼容性问题。

内容的提问来源于stack exchange,提问作者WickedWax

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.13 07:29:50