【问题标题】:How do you get rid of ConfigurationPropertiesRebinderAutoConfiguration INFO log message你如何摆脱 ConfigurationPropertiesRebinderAutoConfiguration INFO 日志消息
【发布时间】:2019-07-14 16:35:36
【问题描述】:

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

INFO 1 --- [main] trationDelegate$BeanPostProcessorChecker : [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$$51f9b0ce] 类型的 Bean 'org.springframework.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 中,但它仍然出现。

【问题讨论】:

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


    【解决方案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

    【讨论】:

      猜你喜欢
      • 2023-02-01
      • 1970-01-01
      • 2019-05-12
      • 2014-06-02
      • 2017-09-13
      • 2020-08-10
      • 1970-01-01
      • 2014-08-27
      • 1970-01-01
      相关资源
      最近更新 更多