欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

 更新時間:2020年02月20日 08:51:39   作者:懶惰的小蝸牛  
今天小編就為大家分享一篇基于spring boot 日志(logback)報(bào)錯的解決方式,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧

記錄一次報(bào)錯解決方法:

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

報(bào)錯后,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)報(bào)錯的解決方式就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • 樹莓派安裝OpenCV3完整過程的實(shí)現(xiàn)

    樹莓派安裝OpenCV3完整過程的實(shí)現(xiàn)

    這篇文章主要介紹了樹莓派安裝OpenCV3完整過程的實(shí)現(xiàn),小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-10-10
  • python爬蟲Mitmproxy安裝使用學(xué)習(xí)筆記

    python爬蟲Mitmproxy安裝使用學(xué)習(xí)筆記

    這篇文章主要介紹了python爬蟲Mitmproxy學(xué)習(xí)筆記分享,有需要的朋友可以收藏學(xué)習(xí)下,希望可以對你有所幫助,大家一起共同學(xué)習(xí),共同進(jìn)步
    2021-09-09
  • Pytorch中expand()的使用(擴(kuò)展某個維度)

    Pytorch中expand()的使用(擴(kuò)展某個維度)

    這篇文章主要介紹了Pytorch中expand()的使用(擴(kuò)展某個維度),具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-07-07
  • 使用Python實(shí)現(xiàn)Excel文件轉(zhuǎn)換為SVG格式

    使用Python實(shí)現(xiàn)Excel文件轉(zhuǎn)換為SVG格式

    SVG(Scalable Vector Graphics)是一種基于XML的矢量圖像格式,這種格式在Web開發(fā)和其他圖形應(yīng)用中非常流行,提供了一種高效的方式來呈現(xiàn)復(fù)雜的矢量圖形,本文將介紹如何使用Python轉(zhuǎn)換Excel文件為SVG格式,需要的朋友可以參考下
    2024-07-07
  • Python實(shí)現(xiàn)新版正方系統(tǒng)滑動驗(yàn)證碼識別

    Python實(shí)現(xiàn)新版正方系統(tǒng)滑動驗(yàn)證碼識別

    這篇文章主要介紹了基于Python實(shí)現(xiàn)新版正方系統(tǒng)滑動驗(yàn)證碼識別算法和方案,文中示例代碼對我們的學(xué)習(xí)和工作有一定的幫助,感興趣的可以了解一下
    2021-12-12
  • python解析Dwarf2格式ELF文件示例

    python解析Dwarf2格式ELF文件示例

    這篇文章主要為大家介紹了python解析Dwarf2格式ELF文件示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪
    2023-08-08
  • python防止程序超時的實(shí)現(xiàn)示例

    python防止程序超時的實(shí)現(xiàn)示例

    因?yàn)槟硞€需求,需要在程序運(yùn)行的時候防止超時,本文主要介紹了python防止程序超時的實(shí)現(xiàn)示例,具有一定的參考價值,感興趣的可以了解一下
    2023-08-08
  • Python3 如何開啟自帶http服務(wù)

    Python3 如何開啟自帶http服務(wù)

    這篇文章主要介紹了Python3 開啟自帶http服務(wù)的操作方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2021-05-05
  • 利用Python讀取微信朋友圈的多種方法總結(jié)

    利用Python讀取微信朋友圈的多種方法總結(jié)

    這篇文章主要給大家介紹了關(guān)于如何利用Python讀取微信朋友圈的多種方法,對于一個新手來說如果單獨(dú)的去爬取朋友圈的話,難度會非常大,可以借鑒這篇文章的內(nèi)容,需要的朋友可以參考下
    2021-08-08
  • python語音識別whisper的使用

    python語音識別whisper的使用

    本文主要介紹了python語音識別whisper的使用,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2023-02-02

最新評論