最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

基于spring boot 日志(logback)報錯的解決方式

 更新時間:2020年02月20日 08:51:39   作者:懶惰的小蝸牛  
今天小編就為大家分享一篇基于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.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發(fā)現(xiàn)沒問題,因此去官網(wǎng)查找

官網(wǎng):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

再次重啟,問題解決

以上這篇基于spring boot 日志(logback)報錯的解決方式就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • python程序主動退出進程的五種方式

    python程序主動退出進程的五種方式

    對于如何結(jié)束一個Python程序或者用Python操作去結(jié)束一個進程等,Python本身給出了好幾種方法,而這些方式也存在著一些區(qū)別,對相關(guān)的幾種方法看了并實踐了下,同時也記錄下,需要的朋友可以參考下
    2024-02-02
  • 教你學會使用Python正則表達式

    教你學會使用Python正則表達式

    正則表達式是一個特殊的字符序列,它能幫助你方便的檢查一個字符串是否與某種模式匹配。 Python 自1.5版本起增加了re 模塊,它提供 Perl 風格的正則表達式模式。re 模塊使 Python 語言擁有全部的正則表達式功能。
    2017-09-09
  • python3的map與reduce實例詳解

    python3的map與reduce實例詳解

    這篇文章主要介紹了Python3中map()、reduce()、filter()的用法詳解,本文通過示例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-08-08
  • Python基于更相減損術(shù)實現(xiàn)求解最大公約數(shù)的方法

    Python基于更相減損術(shù)實現(xiàn)求解最大公約數(shù)的方法

    這篇文章主要介紹了Python基于更相減損術(shù)實現(xiàn)求解最大公約數(shù)的方法,簡單說明了更相減損術(shù)的概念、原理并結(jié)合Python實例形式分析了基于更相減損術(shù)實現(xiàn)求解最大公約數(shù)的相關(guān)操作技巧與注意事項,需要的朋友可以參考下
    2018-04-04
  • 利用Python進行數(shù)據(jù)清洗的操作指南

    利用Python進行數(shù)據(jù)清洗的操作指南

    數(shù)據(jù)清洗是指發(fā)現(xiàn)并糾正數(shù)據(jù)文件中可識別的錯誤的最后一道程序,包括檢查數(shù)據(jù)一致性,處理無效值和缺失值等。本文為大家介紹了Python進行數(shù)據(jù)清洗的操作詳解,需要的可以參考一下
    2022-03-03
  • Python學習之列表和元組的使用詳解

    Python學習之列表和元組的使用詳解

    如果說在Python語言中找一個最優(yōu)秀的數(shù)據(jù)類型,那無疑是列表,如果要在推薦一個,那我選擇元組。本篇文章我們的重心會放在列表上,元組可以看成不能被修改的列表,感興趣的可以了解一下
    2022-10-10
  • python tkinter 獲得按鈕的文本值

    python tkinter 獲得按鈕的文本值

    這篇文章主要介紹了python tkinter 獲得按鈕的文本值,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2021-04-04
  • Python數(shù)據(jù)獲取實現(xiàn)圖片數(shù)據(jù)提取

    Python數(shù)據(jù)獲取實現(xiàn)圖片數(shù)據(jù)提取

    本文主要介紹了Python數(shù)據(jù)獲取實現(xiàn)圖片數(shù)據(jù)提取,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧
    2022-05-05
  • Python xpath表達式如何實現(xiàn)數(shù)據(jù)處理

    Python xpath表達式如何實現(xiàn)數(shù)據(jù)處理

    這篇文章主要介紹了Python xpath表達式如何實現(xiàn)數(shù)據(jù)處理,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友可以參考下
    2020-06-06
  • 常見的python正則用法實例講解

    常見的python正則用法實例講解

    這篇文章為大家詳細主要介紹了常見的python正則用法實例,列舉Python正則表達式的幾種匹配用法,感興趣的小伙伴們可以參考一下
    2016-06-06

最新評論

阿尔山市| 淮北市| 南靖县| 柘城县| 亳州市| 大同县| 华蓥市| 斗六市| 庆城县| 天祝| 合山市| 寿阳县| 米林县| 玛曲县| 江山市| 来安县| 长春市| 阳城县| 富川| 漳浦县| 瓦房店市| 淮安市| 获嘉县| 个旧市| 滨州市| 平远县| 桂林市| 潼南县| 黄陵县| 通许县| 汶川县| 将乐县| 都兰县| 藁城市| 绥棱县| 巧家县| 上饶市| 伊吾县| 郸城县| 集安市| 夹江县|