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

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

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

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

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)錯(cuò)后,spring boot切換回1.5.9發(fā)現(xiàn)沒(méi)問(wè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

再次重啟,問(wèn)題解決

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

相關(guān)文章

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

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

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

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

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

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

    這篇文章主要介紹了Pytorch中expand()的使用(擴(kuò)展某個(gè)維度),具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    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開(kāi)發(fā)和其他圖形應(yīng)用中非常流行,提供了一種高效的方式來(lái)呈現(xiàn)復(fù)雜的矢量圖形,本文將介紹如何使用Python轉(zhuǎn)換Excel文件為SVG格式,需要的朋友可以參考下
    2024-07-07
  • Python實(shí)現(xiàn)新版正方系統(tǒng)滑動(dòng)驗(yàn)證碼識(shí)別

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

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

    python解析Dwarf2格式ELF文件示例

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

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

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

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

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

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

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

    python語(yǔ)音識(shí)別whisper的使用

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

最新評(píng)論