您如何摆脱ConfigurationPropertiesRebinderAutoConfiguration INFO日志消息

时间:2019-02-20 21:39:16

标签: java spring spring-cloud spring-cloud-config

使用spring-cloud-config-starter时,日志中会显示以下消息

  

INFO 1 --- [main] trationDelegate $ BeanPostProcessorChecker:类型为[org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration $$ EnhancerBySpringCGLIB $$ 51f9b0ce]的Bean'org.springframework.cloud.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration'不符合条件由所有BeanPostProcessor处理(例如:不具备自动代理资格)

我尝试了

logging:
  level:
    org.springframework.context.support.PostProcessorRegistrationDelegate$$BeanPostProcessorChecker: WARN
    root: WARN

logging:
  level:
    org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker: WARN
    root: WARN

logging:
  level:
    org.springframework.context.support.PostProcessorRegistrationDelegate.BeanPostProcessorChecker: WARN
    root: WARN

在配置服务器的application.ymlbootstrap.yml中,但它仍然出现。

1 个答案:

答案 0 :(得分:1)

内部类名称需要在application.yml中进行特殊处理:

logging:
  level:
    org.springframework.context.support.[PostProcessorRegistrationDelegate$BeanPostProcessorChecker]: WARN

例如参见:https://github.com/spring-projects/spring-kafka/issues/714

要在属性键名称中包含这些“特殊字符”,您需要利用Spring Boot中基于​​地图的绑定规则:https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-Configuration-Binding#map-based-binding