springboot启动Logback报错ERROR in ch.qos.logback.classic.joran.action.ContextNameAction - Failed to rena
springboot启动logback报错
·
具体报错:
2022-06-28 16:18:02.637 [APPLICATION_NAME_IS_UNDEFINED] [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalStateException: java.lang.IllegalStateException: Logback configuration error detected:
ERROR in ch.qos.logback.classic.joran.action.ContextNameAction - Failed to rename context [APPLICATION_NAME_IS_UNDEFINED] as [zj-demo-service] java.lang.IllegalStateException: Context has been already given a name
经常出现这个错误,特别记录下,Logback文件位置
Logback内容
标题问题原因:
logback-spring.xml的文件名称是Logback的默认文件名,加载顺序有时候优先于spring.application.name,所以导致出问题。
标题解决办法:
把logback-spring.xml的文件名称还成别的。如logback-config.xml,并在application.yml配置文件中指定即可。
更多推荐
已为社区贡献1条内容
所有评论(0)