当我运行我的Sping Boot 应用程序时,我在我的控制台日志中得到条件评估报告。
如何在Sping 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)
...
4条答案
按热度按时间6ljaweal1#
可以通过更改
org.springframework.boot.autconfigure
的日志级别来实现此目的。例如,在application.properties
中添加以下行:piok6c0g2#
如果您符合以下条件,您将获得病情结果报告:
debug=true
。org.springframework.boot.autoconfigure.logging
的日志记录级别设置为DEBUG
。当您试图找出某些Bean未被加载的原因时,这可能很有用,因为通过此报告,您可以准确地看到哪些自动配置正在被加载,哪些没有被加载(以及原因)。
您可以通过撤消前面提到的要点来禁用此输出。例如,您可以将
org.springframework.boot.autoconfigure.logging
的日志记录级别设置为INFO
:dgiusagp3#
当other answer工作时,也可以将日志级别设置为
INFO
:wmvff8tz4#
只需将以下内容添加到application.yml