浅析基于spring boot 日志(logback)报错的解决方式章鱼怪兽盖洛斯

本文是关于浅析基于spring boot 日志(logback)报错的解决方式章鱼怪兽盖洛斯,由西南之窗方言教育网yumixiongdi.com2021-05-22日编辑,基于spring boot 日志(logback)报错的解决方式,章鱼怪兽盖洛斯。


基于spring boot 日志(logback)报错的解决方式,章鱼怪兽盖洛斯… 浅析基于spring boot 日志(logback)报错的解决方式章鱼怪兽盖洛斯

记录一次报错解决方法:

No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.lang.String>]

org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'logging.level' to java.util.Map<java.lang.String, java.lang.String> at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:250) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:226) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:210) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:166) at org.springframework.boot.context.logging.LoggingApplicationListener.setLogLevels(LoggingApplicationListener.java:307) at org.springframework.boot.context.logging.LoggingApplicationListener.initializeFinalLoggingLevels(LoggingApplicationListener.java:290) at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:238) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:200) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:173) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) at org.springframework.boot.context.event.EventPu男子偷拍航母基地blishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:361) at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)Caused by: org.springframework.core.convert.ConverterNotFoundException: No converter found capable of converting from type [java.lang.String] to type [java.util.Map<java.lang.String, java.lang.String>] at org.springframework.core.convert.support.GenericConversionService.handleConverterNotFound(GenericConversionService.java:321) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:194) at org.springframework.boot.context.properties.bind.BindConverter$CompositeConversionService.convert(BindConverter.java:162) at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:96) at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:88) at org.springframework.boot.context.properties.bind.MapBinder.bindAggregate(MapBinder.java:67) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:58) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:305) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:441) at org.springframework.boot.context.properties.bind.Binder$Context.access$100(Binder.java:381) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:304) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:262) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221) ... 18 common frames omitted

application.yml中的原配置如下:(spring boot版本2.0.4)

logging: 馨宜旗path: ./logs/ level: debug

报错后,spring boot切换回1.5.9发现没问题,因此去官网查找

官网:https://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/#boot-features-custom-log-levels

看到这部分

26.4 Log Levels

All the supported logging systems can have the logger levels set in the Spring Environment (for example, in application.properties) by using logging.level.<logger-name>=<level> where level is one of TRACE, DEBUG, INFO, WARN, ERROR, FATAL, o五月思貂r OFF. The root logger can be configured by using logging.level.root.

The following example shows potential logging settings in application.properties:

logging.level.root=WARNlogging.level.org.springframework.web=DEBUGlogging.level.org.hibernate=ERROR

看完这部分,将yml改为如下:

logging: path: ./logs/ level: root: debug

再次重启,问题解决

以上这篇基于spring boot 日志(logback)报错的解决方式就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持个人范文。

章鱼怪兽盖洛斯。
专题推荐:章鱼怪兽盖洛斯(7) 个人资料 清明节的由来及传说 清明寄语写一句话 儿童侦探故事 诗篇第一篇 名人尊师的故事 布衣布舍 荣格奖金制度 杜马禅园 藏名诗 节约用水的故事 开心一日游的心情说说 吊唁词 表决心的话 袋熊的便便 人为什么活着这么累 父夫子德言容功 lia开头的成语 唐之韵解说词 入党积极分子现实表现 学苑新报数学天地答案 骂人秘籍 快板词 晓娜手记 哈登通缉令 拿来主义教案 年鉴怎么写 谐音学韩语 罗马统治时期的英国 质数和合数 女生节祝福语 三八妇女节祝福语 赏花的心情短语 班主任工作随笔 立夏文案 办公室工作总结 工作总结报告 微信 形势 个人总结怎么写 团支部工作总结 新冠疫情工作个人总结 教育教学工作总结 见习总结
本文地址:http://www.yumixiongdi.com/zixue/20210522/224956.html 转载请注明出处!
相关文章: