如何从Spring引导应用程序的控制台中排除条件评估报告?

如何从Spring引导应用程序的控制台中排除条件评估报告?,spring,spring-boot,Spring,Spring Boot,当我运行Spring boot应用程序时,我会在控制台日志中获得条件评估报告 如何在Spring boot中从控制台日志中禁用或排除此报告 ============================ CONDITIONS EVALUATION REPORT ============================ Positive matches: ----------------- AopAutoConfiguration matched: - @ConditionalO

当我运行Spring boot应用程序时,我会在控制台日志中获得条件评估报告

如何在Spring boot中从控制台日志中禁用或排除此报告

============================
CONDITIONS EVALUATION REPORT
============================


Positive matches:
-----------------

   AopAutoConfiguration matched:
      - @ConditionalOnClass found required classes 'org.springframework.context.annotation.EnableAspectJAutoProxy', 'org.aspectj.lang.annotation.Aspect', 'org.aspectj.lang.reflect.Advice', 'org.aspectj.weaver.AnnotatedElement'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
      - @ConditionalOnProperty (spring.aop.auto=true) matched (OnPropertyCondition)

   AopAutoConfiguration.CglibAutoProxyConfiguration matched:
      - @ConditionalOnProperty (spring.aop.proxy-target-class=true) matched (OnPropertyCondition)

   CacheAutoConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.cache.CacheManager'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition)
      - @ConditionalOnBean (types: org.springframework.cache.interceptor.CacheAspectSupport; SearchStrategy: all) found bean 'cacheInterceptor'; @ConditionalOnMissingBean (names: cacheResolver; types: org.springframework.cache.CacheManager; SearchStrategy: all) did not find any beans (OnBeanCondition)

...

您可以通过更改org.springframework.boot.autconfigure的日志级别来实现这一点。例如,在
application.properties
中添加以下行:

logging.level.org.springframework.boot.autoconfigure=ERROR
工作时,还可以将日志级别设置为
INFO

logging.level.org.springframework.boot.autoconfigure=INFO
logging.level.org.springframework.boot.autoconfigure.logging=INFO

如果您:

  • 将IDE配置为显示调试输出(例如,如果在IntelliJ中的Spring引导运行配置中设置了启用调试输出
  • 在application.properties中设置属性
    debug=true
  • org.springframework.boot.autoconfigure.logging
    的日志记录级别设置为
    DEBUG
当您试图找出某些bean没有被加载的原因时,这可能很有用,因为通过此报告,您可以确切地看到哪个自动配置正在被加载,哪个没有(以及为什么)

您可以通过撤消前面提到的要点来禁用此输出。例如,您可以将
org.springframework.boot.autoconfigure.logging
的日志记录级别设置为
INFO

logging.level.org.springframework.boot.autoconfigure=INFO
logging.level.org.springframework.boot.autoconfigure.logging=INFO

将IDE配置为显示调试输出(例如,如果在IntelliJ中的Spring引导运行配置中设置了Enable debug output)我这样做了,我不知道如何禁用它。请帮忙。