基于spring boot 日志(logback)报错的解决方式
作者:懒惰的小蜗牛 发布时间:2022-05-12 08:13:46
记录一次报错解决方法:
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.EventPublishingRunListener.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, or 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=WARN
logging.level.org.springframework.web=DEBUG
logging.level.org.hibernate=ERROR
看完这部分,将yml改为如下:
logging:
path: ./logs/
level:
root: debug
再次重启,问题解决
来源:https://blog.csdn.net/qq_41070393/article/details/82179542


猜你喜欢
- 如下所示:def append(arr, values, axis=None): """ Append val
- 天我们看看import的有关内容。编程时总是用到import导入,动不动就导入,很简单,但import到底是个什么功能,它的本质是什么?一.
- pip源配置文件可以放置的位置:Linux/Unix:/etc/pip.con~/.pip/pip.conf (每一个我都找了都没有,所以我
- 一、定义面向对象设计鼓励将行为分布到各个对象中,把对象划分成更小的粒度,有助于增强对象的可复用性。但由于这些细粒度对象之间的联系激增,又可能
- 1.string.maketrans设置字符串转换规则表(translation table) allchars = string.make
- 本文实例为大家分享了linux采用binary方式安装mysql的具体步骤,供大家参考,具体内容如下1、下载binary文件在官网上下载 m
- 为什么使用Python假设我们有这么一项任务:简单测试局域网中的电脑是否连通.这些电脑的ip范围从192.168.0.101到192.168
- 1.django自定义字段类型,实现非主键字段的自增# -*- encoding: utf-8 -*-from django.db.mode
- PyQt5窗口布局控件QStackedWidget介绍QTackedWidget是一个堆栈窗口控件,可以填充一些小控件,但是同一时间只有一个
- 决策树分类与上一篇博客k近邻分类的最大的区别就在于,k近邻是没有训练过程的,而决策树是通过对训练数据进行分析,从而构造决策树,通过决策树来对
- 准备工作:首先,我们需要 import 几个工具包,一个是 python 标准库中的 wave 模块,用于音频处理操作,另外两个是 nump
- 今天看到某人博客推荐了http://dragoninteractive.com/这个网站,貌似一些效果做的比较不错,于是打开了看看,不过还真
- 要做一个页面上短信息的提示音的功能,本来想用HTML5中Audio+IE下的bgsound来实现,可是发现每种浏览器对Audio的解码类型还
- 通常,为了安全性,数据库只允许通过ssh来访问。例如:mysql数据库放在服务器A上,只允许数据库B来访问,这时,我们需要用机器C去访问数据
- VUE 集成LODOP插件打印Lodop、C-Lodop使用说明及样例http://www.lodop.net/LodopDemo.html
- js对文字进行编码涉及3个函数:escape,encodeURI,encodeURIComponent,相应3个解码函数:unescape,
- 控制字符控制字符(Control Character),或者说非打印字符,出现于特定的信息文本中,表示某一控制功能的字符,如控制符:LF(换
- #1042 - Can't get hostname for your address 使用IP链接或域名链接都可能遇到
- 好久没有更新过PyQt5相关的专题了,今天正好有空就做一个文件、文件内容检索的小工具。目的是为了能够很快的完成的在任意磁盘路径下找到我们需要
- 本文实例为大家分享了Python实现学生管理系统的具体代码,供大家参考,具体内容如下实现从面向过程到面向对象的过度,通过更改前面的学生管理系