当我运行我的Spring引导应用程序时,我在我的控制台日志中得到了条件评估报告。
如何在Spring启动中从控制台日志中禁用或排除此报告?
============================
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)
...
发布于 2018-05-10 13:19:23
您可以通过更改org.springframework.boot.autconfigure
的日志级别来执行此操作。例如,通过在application.properties
中添加以下行
logging.level.org.springframework.boot.autoconfigure=ERROR
发布于 2019-07-18 05:55:29
如果您满足以下条件,您将获得条件结果报告:
debug=true
org.springframework.boot.autoconfigure.logging
的日志记录级别设置为DEBUG
.当您试图找出某些bean没有被加载的原因时,这会很有用,因为通过这个报告,您可以确切地看到哪个自动配置正在被加载,哪个没有被加载(以及原因)。
您可以通过撤消前面提到的要点来禁用此输出。例如,可以将org.springframework.boot.autoconfigure.logging
的日志记录级别设置为INFO
logging.level.org.springframework.boot.autoconfigure.logging=INFO
发布于 2019-03-08 14:17:40
当other answer正常工作时,还可以将日志级别设置为INFO
logging.level.org.springframework.boot.autoconfigure=INFO
https://stackoverflow.com/questions/50273570
复制相似问题