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:242) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:218) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:202) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:172) at org.springframework.boot.context.logging.LoggingApplicationListener.setLogLevels(LoggingApplicationListener.java:338) at org.springframework.boot.context.logging.LoggingApplicationListener.initializeFinalLoggingLevels(LoggingApplicationListener.java:314) at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:265) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:226) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:203) 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:76) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:53) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:342) at org.springframework.boot.SpringApplication.run(SpringApplication.java:305) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) at com.example.seller.SellerApplication.main(SellerApplication.java:10) 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:170) 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:64) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:429) at org.springframework.boot.context.properties.bind.Binder$Context.access$100(Binder.java:372) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:293) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:254) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:214) ... 18 common frames omitted
项目初始化,使用logback进行管理项目日志的时候,直接启动就会报错为如上所示:
只需要在.yml配置文件中,添加如下的配置:
#logback配置 logging: pattern: console: ‘%d -%msg%n‘ path: D:/data/log/seller.log level: root: debug
Failed to bind properties under 'logging.level' to java.util.Map<java.lang.String, java.lang.String>
原文:https://www.cnblogs.com/qingmuchuanqi48/p/11605441.html