转载

springboot2启动信息去除CONDITIONS EVALUATION REPORT后引发的思考

前言

最近启动一个springboot2.2+版本项目时,发现控制台输出

17:22:05 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.cloud.util.random.CachedRandomPropertySourceAutoConfiguration'
17:22:05 [main] DEBUG o.s.b.a.l.ConditionEvaluationReportLoggingListener - 


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


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

   ConfigurationPropertiesRebinderAutoConfiguration matched:
      - @ConditionalOnBean (types: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor; SearchStrategy: all) found bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' (OnBeanCondition)

   ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesBeans matched:
      - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesBeans; SearchStrategy: current) did not find any beans (OnBeanCondition)

   ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesRebinder matched:
      - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; SearchStrategy: current) did not find any beans (OnBeanCondition)

   EncryptionBootstrapConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.security.crypto.encrypt.TextEncryptor' (OnClassCondition)

   PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:
      - @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)


Negative matches:
-----------------

   EncryptionBootstrapConfiguration.RsaEncryptionConfiguration:
      Did not match:
         - Keystore nor key found in Environment (EncryptionBootstrapConfiguration.KeyCondition)
      Matched:
         - @ConditionalOnClass found required class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition)

   EncryptionBootstrapConfiguration.VanillaEncryptionConfiguration:
      Did not match:
         - @ConditionalOnMissingClass found unwanted class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition)

   EurekaDiscoveryClientConfigServiceBootstrapConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' (OnClassCondition)


Exclusions:
-----------

    None


Unconditional classes:
----------------------

    None



17:22:13 [main] DEBUG o.s.b.c.l.ClasspathLoggingApplicationListener - Application started with classpath: [file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/charsets.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/deploy.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/access-bridge-64.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/cldrdata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/dnsns.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jaccess.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jfxrt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/localedata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/nashorn.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunec.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunjce_provider.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunmscapi.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunpkcs11.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/zipfs.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/javaws.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jce.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfr.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfxswt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jsse.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/management-agent.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/plugin.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/resources.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/rt.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-biz/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-starter/2.2.5.RELEASE/spring-boot-starter-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot/2.2.5.RELEASE/spring-boot-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-logging/2.2.5.RELEASE/spring-boot-starter-logging-2.2.5.RELEASE.jar, file:/D:/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/D:/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/D:/repository/org/apache/logging/log4j/log4j-to-slf4j/2.12.1/log4j-to-slf4j-2.12.1.jar, file:/D:/repository/org/apache/logging/log4j/log4j-api/2.12.1/log4j-api-2.12.1.jar, file:/D:/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar, file:/D:/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar, file:/D:/repository/org/yaml/snakeyaml/1.25/snakeyaml-1.25.jar, file:/D:/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar, file:/D:/repository/org/springframework/spring-core/5.2.4.RELEASE/spring-core-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-jcl/5.2.4.RELEASE/spring-jcl-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-web/2.2.5.RELEASE/spring-boot-starter-web-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-json/2.2.5.RELEASE/spring-boot-starter-json-2.2.5.RELEASE.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-databind/2.10.2/jackson-databind-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.2/jackson-datatype-jdk8-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.2/jackson-datatype-jsr310-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.2/jackson-module-parameter-names-2.10.2.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-tomcat/2.2.5.RELEASE/spring-boot-starter-tomcat-2.2.5.RELEASE.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.31/tomcat-embed-core-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.31/tomcat-embed-el-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.31/tomcat-embed-websocket-9.0.31.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-validation/2.2.5.RELEASE/spring-boot-starter-validation-2.2.5.RELEASE.jar, file:/D:/repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar, file:/D:/repository/org/hibernate/validator/hibernate-validator/6.0.18.Final/hibernate-validator-6.0.18.Final.jar, file:/D:/repository/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar, file:/D:/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar, file:/D:/repository/org/springframework/spring-web/5.2.4.RELEASE/spring-web-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-beans/5.2.4.RELEASE/spring-beans-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-webmvc/5.2.4.RELEASE/spring-webmvc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-aop/5.2.4.RELEASE/spring-aop-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-context/5.2.4.RELEASE/spring-context-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-expression/5.2.4.RELEASE/spring-expression-5.2.4.RELEASE.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-api/target/classes/, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.2.RELEASE/spring-cloud-starter-openfeign-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-openfeign-core/2.2.2.RELEASE/spring-cloud-openfeign-core-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar, file:/D:/repository/io/github/openfeign/form/feign-form/3.8.0/feign-form-3.8.0.jar, file:/D:/repository/commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar, file:/D:/repository/commons-io/commons-io/2.6/commons-io-2.6.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-commons/2.2.2.RELEASE/spring-cloud-commons-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/feign-core/10.7.4/feign-core-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-slf4j/10.7.4/feign-slf4j-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-hystrix/10.7.4/feign-hystrix-10.7.4.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-rpc-framework/target/classes/, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-common-trace/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-configuration-processor/2.2.5.RELEASE/spring-boot-configuration-processor-2.2.5.RELEASE.jar, file:/D:/repository/com/dianping/cat/cat-client/3.0.0/cat-client-3.0.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-client/1.6.0/apollo-client-1.6.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-core/1.6.0/apollo-core-1.6.0.jar, file:/D:/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar, file:/D:/repository/org/mybatis/mybatis/3.5.3/mybatis-3.5.3.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-common/target/classes/, file:/D:/repository/org/apache/shiro/shiro-core/1.5.3/shiro-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-lang/1.5.3/shiro-lang-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-cache/1.5.3/shiro-cache-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-hash/1.5.3/shiro-crypto-hash-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-core/1.5.3/shiro-crypto-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-cipher/1.5.3/shiro-crypto-cipher-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-core/1.5.3/shiro-config-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-ogdl/1.5.3/shiro-config-ogdl-1.5.3.jar, file:/D:/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar, file:/D:/repository/org/apache/shiro/shiro-event/1.5.3/shiro-event-1.5.3.jar, file:/D:/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar, file:/D:/repository/com/baomidou/mybatis-plus-boot-starter/3.3.1/mybatis-plus-boot-starter-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus/3.3.1/mybatis-plus-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-extension/3.3.1/mybatis-plus-extension-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-core/3.3.1/mybatis-plus-core-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-annotation/3.3.1/mybatis-plus-annotation-3.3.1.jar, file:/D:/repository/com/github/jsqlparser/jsqlparser/3.1/jsqlparser-3.1.jar, file:/D:/repository/org/mybatis/mybatis-spring/2.0.3/mybatis-spring-2.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-autoconfigure/2.2.5.RELEASE/spring-boot-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-jdbc/2.2.5.RELEASE/spring-boot-starter-jdbc-2.2.5.RELEASE.jar, file:/D:/repository/com/zaxxer/HikariCP/3.4.2/HikariCP-3.4.2.jar, file:/D:/repository/org/springframework/spring-jdbc/5.2.4.RELEASE/spring-jdbc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-tx/5.2.4.RELEASE/spring-tx-5.2.4.RELEASE.jar, file:/D:/repository/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar, file:/D:/repository/com/alibaba/druid/1.0.28/druid-1.0.28.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/jconsole.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/tools.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-starter-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter/2.2.2.RELEASE/spring-cloud-starter-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-rsa/1.0.9.RELEASE/spring-security-rsa-1.0.9.RELEASE.jar, file:/D:/repository/org/bouncycastle/bcpkix-jdk15on/1.64/bcpkix-jdk15on-1.64.jar, file:/D:/repository/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-hystrix/2.2.2.RELEASE/spring-cloud-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-aop/2.2.5.RELEASE/spring-boot-starter-aop-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/eureka/eureka-client/1.9.17/eureka-client-1.9.17.jar, file:/D:/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/D:/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar, file:/D:/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar, file:/D:/repository/joda-time/joda-time/2.10.5/joda-time-2.10.5.jar, file:/D:/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar, file:/D:/repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar, file:/D:/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/D:/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar, file:/D:/repository/com/netflix/archaius/archaius-core/0.7.6/archaius-core-0.7.6.jar, file:/D:/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/D:/repository/com/netflix/servo/servo-core/0.12.21/servo-core-0.12.21.jar, file:/D:/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/D:/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/D:/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/D:/repository/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar, file:/D:/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar, file:/D:/repository/commons-codec/commons-codec/1.14/commons-codec-1.14.jar, file:/D:/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar, file:/D:/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/D:/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-annotations/2.10.2/jackson-annotations-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-core/2.10.2/jackson-core-2.10.2.jar, file:/D:/repository/com/netflix/eureka/eureka-core/1.9.17/eureka-core-1.9.17.jar, file:/D:/repository/com/fasterxml/woodstox/woodstox-core/5.0.3/woodstox-core-5.0.3.jar, file:/D:/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-archaius/2.2.2.RELEASE/spring-cloud-starter-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-archaius/2.2.2.RELEASE/spring-cloud-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-ribbon/2.2.2.RELEASE/spring-cloud-starter-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/ribbon/ribbon/2.3.0/ribbon-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-transport/2.3.0/ribbon-transport-2.3.0.jar, file:/D:/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/D:/repository/com/netflix/ribbon/ribbon-core/2.3.0/ribbon-core-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-httpclient/2.3.0/ribbon-httpclient-2.3.0.jar, file:/D:/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-commons-util/0.3.0/netflix-commons-util-0.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-loadbalancer/2.3.0/ribbon-loadbalancer-2.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/D:/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-loadbalancer/2.2.2.RELEASE/spring-cloud-starter-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-loadbalancer/2.2.2.RELEASE/spring-cloud-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/io/projectreactor/reactor-core/3.3.3.RELEASE/reactor-core-3.3.3.RELEASE.jar, file:/D:/repository/io/projectreactor/addons/reactor-extra/3.3.2.RELEASE/reactor-extra-3.3.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-cache/2.2.5.RELEASE/spring-boot-starter-cache-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/spring-context-support/5.2.4.RELEASE/spring-context-support-5.2.4.RELEASE.jar, file:/D:/repository/com/stoyanr/evictor/1.0.0/evictor-1.0.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-eureka/2.3.0/ribbon-eureka-2.3.0.jar, file:/D:/repository/com/thoughtworks/xstream/xstream/1.4.12/xstream-1.4.12.jar, file:/D:/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/D:/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-hystrix/2.2.2.RELEASE/spring-cloud-starter-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-ribbon/2.2.2.RELEASE/spring-cloud-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/hystrix/hystrix-core/1.5.18/hystrix-core-1.5.18.jar, file:/D:/repository/org/hdrhistogram/HdrHistogram/2.1.9/HdrHistogram-2.1.9.jar, file:/D:/repository/com/netflix/hystrix/hystrix-serialization/1.5.18/hystrix-serialization-1.5.18.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-afterburner/2.10.2/jackson-module-afterburner-2.10.2.jar, file:/D:/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.5.18/hystrix-metrics-event-stream-1.5.18.jar, file:/D:/repository/com/netflix/hystrix/hystrix-javanica/1.5.18/hystrix-javanica-1.5.18.jar, file:/D:/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/D:/repository/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar, file:/D:/repository/com/google/guava/guava/28.2-android/guava-28.2-android.jar, file:/D:/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar, file:/D:/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar, file:/D:/repository/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar, file:/D:/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar, file:/D:/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar, file:/D:/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar, file:/D:/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-actuator/2.2.5.RELEASE/spring-boot-starter-actuator-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator-autoconfigure/2.2.5.RELEASE/spring-boot-actuator-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator/2.2.5.RELEASE/spring-boot-actuator-2.2.5.RELEASE.jar, file:/D:/repository/io/micrometer/micrometer-core/1.3.5/micrometer-core-1.3.5.jar, file:/D:/repository/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar, file:/D:/repository/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-context/2.2.3.RELEASE/spring-cloud-context-2.2.3.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-crypto/5.2.2.RELEASE/spring-security-crypto-5.2.2.RELEASE.jar, file:/D:/repository/cn/hutool/hutool-all/5.3.5/hutool-all-5.3.5.jar, file:/D:/repository/de/codecentric/spring-boot-admin-starter-client/2.2.3/spring-boot-admin-starter-client-2.2.3.jar, file:/D:/repository/de/codecentric/spring-boot-admin-client/2.2.3/spring-boot-admin-client-2.2.3.jar, file:/F:/soft/idea/idea/lib/idea_rt.jar, file:/F:/soft/idea/idea/plugins/java/lib/rt/debugger-agent.jar]

  .   ____          _            __ _ _
 /// / ___'_ __ _ _(_)_ __  __ _ / / / /
( ( )/___ | '_ | '_| | '_ // _` | / / / /
 ///  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_/__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.5.RELEASE)

17:22:13 [main] DEBUG c.c.f.a.s.b.ApolloApplicationContextInitializer - Apollo bootstrap config is not enabled for context org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@3e6534e7, started on Thu Jan 01 08:00:00 CST 1970, parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@62f87c44, see property: ${apollo.bootstrap.enabled}
17:22:13 [main] INFO  com.nisbos.goods.GoodsApplication - No active profile set, falling back to default profiles: default

。。。省略后续日志

这个日志如果不细看还以为是启动报错,其实这段日志是springboot2的自动装配日志报告。平时我们是不大需要,因此我们可以关闭。关闭的方法也很简单,从控制台打印的日志信息我们可以得知自动装配日志报告是由

org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener

这个类触发,而且日志级别是Debug级别。因此要关闭这段日志,只需在application.yml做如下配置

logging:
  level:
    org:
      springframework:
        boot:
          autoconfigure:
            logging: info

日志级别改为debug级别以上就行了。然后启动见证一下奇迹,奇迹没出现,自动装配日志报告依然坚挺的出现,并带着嘲笑的嘴脸,看你装逼。

排查

以多年的编程直觉,我这么写应该是没错的,错的原因可能就是把正确的内容放到不恰当的位置,导致不起作用。带着这个主观臆断的思路,我们可以思考下,正常我们控制台打印日志信息的日志级别会配置在哪里,一个是配置文件比如application.yml,一个是配置在日志文件中(比如logback文件中),当然也可以借助其他工具进行配置(这个我们就不讨论了,因为我不会)

验证

既然我们在application.yml配置不起效果,那我们就在项目中已经配置的logback-spring.xml中加如下内容

<logger level="info" name="org.springframework.boot.autoconfigure.logging"  additivity="false">
        <appender-ref ref="console"/>
        <appender-ref ref="logFile" />
    </logger>

然后再启动试下,这次看下控制台

7:26:09 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Autowiring by type from bean name 'configurationPropertiesRebinder' via factory method to bean named 'configurationPropertiesBeans'
17:26:09 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration'
17:26:09 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.cloud.util.random.CachedRandomPropertySourceAutoConfiguration'
17:26:18 [main] DEBUG o.s.b.c.l.ClasspathLoggingApplicationListener - Application started with classpath: [file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/charsets.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/deploy.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/access-bridge-64.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/cldrdata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/dnsns.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jaccess.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jfxrt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/localedata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/nashorn.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunec.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunjce_provider.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunmscapi.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunpkcs11.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/zipfs.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/javaws.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jce.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfr.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfxswt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jsse.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/management-agent.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/plugin.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/resources.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/rt.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-biz/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-starter/2.2.5.RELEASE/spring-boot-starter-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot/2.2.5.RELEASE/spring-boot-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-logging/2.2.5.RELEASE/spring-boot-starter-logging-2.2.5.RELEASE.jar, file:/D:/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/D:/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/D:/repository/org/apache/logging/log4j/log4j-to-slf4j/2.12.1/log4j-to-slf4j-2.12.1.jar, file:/D:/repository/org/apache/logging/log4j/log4j-api/2.12.1/log4j-api-2.12.1.jar, file:/D:/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar, file:/D:/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar, file:/D:/repository/org/yaml/snakeyaml/1.25/snakeyaml-1.25.jar, file:/D:/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar, file:/D:/repository/org/springframework/spring-core/5.2.4.RELEASE/spring-core-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-jcl/5.2.4.RELEASE/spring-jcl-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-web/2.2.5.RELEASE/spring-boot-starter-web-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-json/2.2.5.RELEASE/spring-boot-starter-json-2.2.5.RELEASE.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-databind/2.10.2/jackson-databind-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.2/jackson-datatype-jdk8-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.2/jackson-datatype-jsr310-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.2/jackson-module-parameter-names-2.10.2.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-tomcat/2.2.5.RELEASE/spring-boot-starter-tomcat-2.2.5.RELEASE.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.31/tomcat-embed-core-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.31/tomcat-embed-el-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.31/tomcat-embed-websocket-9.0.31.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-validation/2.2.5.RELEASE/spring-boot-starter-validation-2.2.5.RELEASE.jar, file:/D:/repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar, file:/D:/repository/org/hibernate/validator/hibernate-validator/6.0.18.Final/hibernate-validator-6.0.18.Final.jar, file:/D:/repository/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar, file:/D:/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar, file:/D:/repository/org/springframework/spring-web/5.2.4.RELEASE/spring-web-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-beans/5.2.4.RELEASE/spring-beans-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-webmvc/5.2.4.RELEASE/spring-webmvc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-aop/5.2.4.RELEASE/spring-aop-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-context/5.2.4.RELEASE/spring-context-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-expression/5.2.4.RELEASE/spring-expression-5.2.4.RELEASE.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-api/target/classes/, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.2.RELEASE/spring-cloud-starter-openfeign-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-openfeign-core/2.2.2.RELEASE/spring-cloud-openfeign-core-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar, file:/D:/repository/io/github/openfeign/form/feign-form/3.8.0/feign-form-3.8.0.jar, file:/D:/repository/commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar, file:/D:/repository/commons-io/commons-io/2.6/commons-io-2.6.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-commons/2.2.2.RELEASE/spring-cloud-commons-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/feign-core/10.7.4/feign-core-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-slf4j/10.7.4/feign-slf4j-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-hystrix/10.7.4/feign-hystrix-10.7.4.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-rpc-framework/target/classes/, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-common-trace/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-configuration-processor/2.2.5.RELEASE/spring-boot-configuration-processor-2.2.5.RELEASE.jar, file:/D:/repository/com/dianping/cat/cat-client/3.0.0/cat-client-3.0.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-client/1.6.0/apollo-client-1.6.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-core/1.6.0/apollo-core-1.6.0.jar, file:/D:/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar, file:/D:/repository/org/mybatis/mybatis/3.5.3/mybatis-3.5.3.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-common/target/classes/, file:/D:/repository/org/apache/shiro/shiro-core/1.5.3/shiro-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-lang/1.5.3/shiro-lang-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-cache/1.5.3/shiro-cache-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-hash/1.5.3/shiro-crypto-hash-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-core/1.5.3/shiro-crypto-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-cipher/1.5.3/shiro-crypto-cipher-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-core/1.5.3/shiro-config-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-ogdl/1.5.3/shiro-config-ogdl-1.5.3.jar, file:/D:/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar, file:/D:/repository/org/apache/shiro/shiro-event/1.5.3/shiro-event-1.5.3.jar, file:/D:/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar, file:/D:/repository/com/baomidou/mybatis-plus-boot-starter/3.3.1/mybatis-plus-boot-starter-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus/3.3.1/mybatis-plus-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-extension/3.3.1/mybatis-plus-extension-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-core/3.3.1/mybatis-plus-core-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-annotation/3.3.1/mybatis-plus-annotation-3.3.1.jar, file:/D:/repository/com/github/jsqlparser/jsqlparser/3.1/jsqlparser-3.1.jar, file:/D:/repository/org/mybatis/mybatis-spring/2.0.3/mybatis-spring-2.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-autoconfigure/2.2.5.RELEASE/spring-boot-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-jdbc/2.2.5.RELEASE/spring-boot-starter-jdbc-2.2.5.RELEASE.jar, file:/D:/repository/com/zaxxer/HikariCP/3.4.2/HikariCP-3.4.2.jar, file:/D:/repository/org/springframework/spring-jdbc/5.2.4.RELEASE/spring-jdbc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-tx/5.2.4.RELEASE/spring-tx-5.2.4.RELEASE.jar, file:/D:/repository/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar, file:/D:/repository/com/alibaba/druid/1.0.28/druid-1.0.28.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/jconsole.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/tools.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-starter-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter/2.2.2.RELEASE/spring-cloud-starter-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-rsa/1.0.9.RELEASE/spring-security-rsa-1.0.9.RELEASE.jar, file:/D:/repository/org/bouncycastle/bcpkix-jdk15on/1.64/bcpkix-jdk15on-1.64.jar, file:/D:/repository/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-hystrix/2.2.2.RELEASE/spring-cloud-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-aop/2.2.5.RELEASE/spring-boot-starter-aop-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/eureka/eureka-client/1.9.17/eureka-client-1.9.17.jar, file:/D:/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/D:/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar, file:/D:/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar, file:/D:/repository/joda-time/joda-time/2.10.5/joda-time-2.10.5.jar, file:/D:/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar, file:/D:/repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar, file:/D:/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/D:/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar, file:/D:/repository/com/netflix/archaius/archaius-core/0.7.6/archaius-core-0.7.6.jar, file:/D:/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/D:/repository/com/netflix/servo/servo-core/0.12.21/servo-core-0.12.21.jar, file:/D:/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/D:/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/D:/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/D:/repository/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar, file:/D:/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar, file:/D:/repository/commons-codec/commons-codec/1.14/commons-codec-1.14.jar, file:/D:/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar, file:/D:/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/D:/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-annotations/2.10.2/jackson-annotations-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-core/2.10.2/jackson-core-2.10.2.jar, file:/D:/repository/com/netflix/eureka/eureka-core/1.9.17/eureka-core-1.9.17.jar, file:/D:/repository/com/fasterxml/woodstox/woodstox-core/5.0.3/woodstox-core-5.0.3.jar, file:/D:/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-archaius/2.2.2.RELEASE/spring-cloud-starter-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-archaius/2.2.2.RELEASE/spring-cloud-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-ribbon/2.2.2.RELEASE/spring-cloud-starter-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/ribbon/ribbon/2.3.0/ribbon-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-transport/2.3.0/ribbon-transport-2.3.0.jar, file:/D:/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/D:/repository/com/netflix/ribbon/ribbon-core/2.3.0/ribbon-core-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-httpclient/2.3.0/ribbon-httpclient-2.3.0.jar, file:/D:/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-commons-util/0.3.0/netflix-commons-util-0.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-loadbalancer/2.3.0/ribbon-loadbalancer-2.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/D:/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-loadbalancer/2.2.2.RELEASE/spring-cloud-starter-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-loadbalancer/2.2.2.RELEASE/spring-cloud-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/io/projectreactor/reactor-core/3.3.3.RELEASE/reactor-core-3.3.3.RELEASE.jar, file:/D:/repository/io/projectreactor/addons/reactor-extra/3.3.2.RELEASE/reactor-extra-3.3.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-cache/2.2.5.RELEASE/spring-boot-starter-cache-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/spring-context-support/5.2.4.RELEASE/spring-context-support-5.2.4.RELEASE.jar, file:/D:/repository/com/stoyanr/evictor/1.0.0/evictor-1.0.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-eureka/2.3.0/ribbon-eureka-2.3.0.jar, file:/D:/repository/com/thoughtworks/xstream/xstream/1.4.12/xstream-1.4.12.jar, file:/D:/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/D:/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-hystrix/2.2.2.RELEASE/spring-cloud-starter-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-ribbon/2.2.2.RELEASE/spring-cloud-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/hystrix/hystrix-core/1.5.18/hystrix-core-1.5.18.jar, file:/D:/repository/org/hdrhistogram/HdrHistogram/2.1.9/HdrHistogram-2.1.9.jar, file:/D:/repository/com/netflix/hystrix/hystrix-serialization/1.5.18/hystrix-serialization-1.5.18.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-afterburner/2.10.2/jackson-module-afterburner-2.10.2.jar, file:/D:/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.5.18/hystrix-metrics-event-stream-1.5.18.jar, file:/D:/repository/com/netflix/hystrix/hystrix-javanica/1.5.18/hystrix-javanica-1.5.18.jar, file:/D:/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/D:/repository/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar, file:/D:/repository/com/google/guava/guava/28.2-android/guava-28.2-android.jar, file:/D:/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar, file:/D:/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar, file:/D:/repository/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar, file:/D:/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar, file:/D:/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar, file:/D:/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar, file:/D:/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-actuator/2.2.5.RELEASE/spring-boot-starter-actuator-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator-autoconfigure/2.2.5.RELEASE/spring-boot-actuator-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator/2.2.5.RELEASE/spring-boot-actuator-2.2.5.RELEASE.jar, file:/D:/repository/io/micrometer/micrometer-core/1.3.5/micrometer-core-1.3.5.jar, file:/D:/repository/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar, file:/D:/repository/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-context/2.2.3.RELEASE/spring-cloud-context-2.2.3.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-crypto/5.2.2.RELEASE/spring-security-crypto-5.2.2.RELEASE.jar, file:/D:/repository/cn/hutool/hutool-all/5.3.5/hutool-all-5.3.5.jar, file:/D:/repository/de/codecentric/spring-boot-admin-starter-client/2.2.3/spring-boot-admin-starter-client-2.2.3.jar, file:/D:/repository/de/codecentric/spring-boot-admin-client/2.2.3/spring-boot-admin-client-2.2.3.jar, file:/F:/soft/idea/idea/lib/idea_rt.jar, file:/F:/soft/idea/idea/plugins/java/lib/rt/debugger-agent.jar]

  .   ____          _            __ _ _
 /// / ___'_ __ _ _(_)_ __  __ _ / / / /
( ( )/___ | '_ | '_| | '_ // _` | / / / /
 ///  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_/__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.5.RELEASE)

17:26:18 [main] DEBUG c.c.f.a.s.b.ApolloApplicationContextInitializer - Apollo bootstrap config is not enabled for context
。。。省略后续日志

很明显这次我们成功了

Q&A

1、当项目中只有application.yml文件时,配置的日志级别是否生效?

会生效

验证

去除项目中的logback-spring.xml,然后在application.yml配置如下内容

logging:
  level:
    org:
      springframework:
        boot:
          autoconfigure:
            logging: info

启动查看日志信息

Connected to the target VM, address: '127.0.0.1:59757', transport: 'socket'

  .   ____          _            __ _ _
 /// / ___'_ __ _ _(_)_ __  __ _ / / / /
( ( )/___ | '_ | '_| | '_ // _` | / / / /
 ///  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_/__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.5.RELEASE)

2020-07-14 19:08:53.345  INFO 5868 --- [           main] com.nisbos.goods.GoodsApplication        : No active profile set, falling back to default profiles: default
2020-07-14 19:08:54.853  WARN 5868 --- [           main] o.s.boot.actuate.endpoint.EndpointId     : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2020-07-14 19:08:54.874  WARN 5868 --- [           main] o.s.boot.actuate.endpoint.EndpointId

说明配置生效

2、当项目中同时存在logback-spring.xml和application.yml,同种类包日志级别配置以哪个为准?

以logback-spring.xml配置的日志级别为准

验证一

logback-spring.xml配置日志级别为debug

<logger level="debug" name="org.springframework.boot.autoconfigure.logging"  additivity="false">
        <appender-ref ref="console"/>
        <appender-ref ref="logFile" />
    </logger>

application.yml配置日志级别为info

logging:
  org:
    springframework:
      boot:
        autoconfigure:
          logging: info

启动查看控制台

11:00:41 [main] DEBUG o.s.b.a.l.ConditionEvaluationReportLoggingListener - 


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


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

   ConfigurationPropertiesRebinderAutoConfiguration matched:
      - @ConditionalOnBean (types: org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor; SearchStrategy: all) found bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor' (OnBeanCondition)

   ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesBeans matched:
      - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesBeans; SearchStrategy: current) did not find any beans (OnBeanCondition)

   ConfigurationPropertiesRebinderAutoConfiguration#configurationPropertiesRebinder matched:
      - @ConditionalOnMissingBean (types: org.springframework.cloud.context.properties.ConfigurationPropertiesRebinder; SearchStrategy: current) did not find any beans (OnBeanCondition)

   EncryptionBootstrapConfiguration matched:
      - @ConditionalOnClass found required class 'org.springframework.security.crypto.encrypt.TextEncryptor' (OnClassCondition)

   PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer matched:
      - @ConditionalOnMissingBean (types: org.springframework.context.support.PropertySourcesPlaceholderConfigurer; SearchStrategy: current) did not find any beans (OnBeanCondition)


Negative matches:
-----------------

   EncryptionBootstrapConfiguration.RsaEncryptionConfiguration:
      Did not match:
         - Keystore nor key found in Environment (EncryptionBootstrapConfiguration.KeyCondition)
      Matched:
         - @ConditionalOnClass found required class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition)

   EncryptionBootstrapConfiguration.VanillaEncryptionConfiguration:
      Did not match:
         - @ConditionalOnMissingClass found unwanted class 'org.springframework.security.rsa.crypto.RsaSecretEncryptor' (OnClassCondition)

   EurekaDiscoveryClientConfigServiceBootstrapConfiguration:
      Did not match:
         - @ConditionalOnClass did not find required class 'org.springframework.cloud.config.client.ConfigServicePropertySourceLocator' (OnClassCondition)


Exclusions:
-----------

    None


Unconditional classes:
----------------------

    None



11:00:50 [main] DEBUG o.s.b.c.l.ClasspathLoggingApplicationListener - Application started with classpath: [file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/charsets.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/deploy.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/access-bridge-64.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/cldrdata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/dnsns.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jaccess.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jfxrt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/localedata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/nashorn.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunec.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunjce_provider.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunmscapi.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunpkcs11.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/zipfs.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/javaws.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jce.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfr.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfxswt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jsse.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/management-agent.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/plugin.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/resources.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/rt.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-biz/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-starter/2.2.5.RELEASE/spring-boot-starter-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot/2.2.5.RELEASE/spring-boot-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-logging/2.2.5.RELEASE/spring-boot-starter-logging-2.2.5.RELEASE.jar, file:/D:/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/D:/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/D:/repository/org/apache/logging/log4j/log4j-to-slf4j/2.12.1/log4j-to-slf4j-2.12.1.jar, file:/D:/repository/org/apache/logging/log4j/log4j-api/2.12.1/log4j-api-2.12.1.jar, file:/D:/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar, file:/D:/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar, file:/D:/repository/org/yaml/snakeyaml/1.25/snakeyaml-1.25.jar, file:/D:/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar, file:/D:/repository/org/springframework/spring-core/5.2.4.RELEASE/spring-core-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-jcl/5.2.4.RELEASE/spring-jcl-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-web/2.2.5.RELEASE/spring-boot-starter-web-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-json/2.2.5.RELEASE/spring-boot-starter-json-2.2.5.RELEASE.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-databind/2.10.2/jackson-databind-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.2/jackson-datatype-jdk8-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.2/jackson-datatype-jsr310-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.2/jackson-module-parameter-names-2.10.2.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-tomcat/2.2.5.RELEASE/spring-boot-starter-tomcat-2.2.5.RELEASE.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.31/tomcat-embed-core-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.31/tomcat-embed-el-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.31/tomcat-embed-websocket-9.0.31.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-validation/2.2.5.RELEASE/spring-boot-starter-validation-2.2.5.RELEASE.jar, file:/D:/repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar, file:/D:/repository/org/hibernate/validator/hibernate-validator/6.0.18.Final/hibernate-validator-6.0.18.Final.jar, file:/D:/repository/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar, file:/D:/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar, file:/D:/repository/org/springframework/spring-web/5.2.4.RELEASE/spring-web-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-beans/5.2.4.RELEASE/spring-beans-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-webmvc/5.2.4.RELEASE/spring-webmvc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-aop/5.2.4.RELEASE/spring-aop-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-context/5.2.4.RELEASE/spring-context-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-expression/5.2.4.RELEASE/spring-expression-5.2.4.RELEASE.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-api/target/classes/, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.2.RELEASE/spring-cloud-starter-openfeign-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-openfeign-core/2.2.2.RELEASE/spring-cloud-openfeign-core-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar, file:/D:/repository/io/github/openfeign/form/feign-form/3.8.0/feign-form-3.8.0.jar, file:/D:/repository/commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar, file:/D:/repository/commons-io/commons-io/2.6/commons-io-2.6.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-commons/2.2.2.RELEASE/spring-cloud-commons-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/feign-core/10.7.4/feign-core-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-slf4j/10.7.4/feign-slf4j-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-hystrix/10.7.4/feign-hystrix-10.7.4.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-rpc-framework/target/classes/, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-common-trace/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-configuration-processor/2.2.5.RELEASE/spring-boot-configuration-processor-2.2.5.RELEASE.jar, file:/D:/repository/com/dianping/cat/cat-client/3.0.0/cat-client-3.0.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-client/1.6.0/apollo-client-1.6.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-core/1.6.0/apollo-core-1.6.0.jar, file:/D:/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar, file:/D:/repository/org/mybatis/mybatis/3.5.3/mybatis-3.5.3.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-common/target/classes/, file:/D:/repository/org/apache/shiro/shiro-core/1.5.3/shiro-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-lang/1.5.3/shiro-lang-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-cache/1.5.3/shiro-cache-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-hash/1.5.3/shiro-crypto-hash-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-core/1.5.3/shiro-crypto-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-cipher/1.5.3/shiro-crypto-cipher-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-core/1.5.3/shiro-config-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-ogdl/1.5.3/shiro-config-ogdl-1.5.3.jar, file:/D:/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar, file:/D:/repository/org/apache/shiro/shiro-event/1.5.3/shiro-event-1.5.3.jar, file:/D:/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar, file:/D:/repository/com/baomidou/mybatis-plus-boot-starter/3.3.1/mybatis-plus-boot-starter-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus/3.3.1/mybatis-plus-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-extension/3.3.1/mybatis-plus-extension-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-core/3.3.1/mybatis-plus-core-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-annotation/3.3.1/mybatis-plus-annotation-3.3.1.jar, file:/D:/repository/com/github/jsqlparser/jsqlparser/3.1/jsqlparser-3.1.jar, file:/D:/repository/org/mybatis/mybatis-spring/2.0.3/mybatis-spring-2.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-autoconfigure/2.2.5.RELEASE/spring-boot-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-jdbc/2.2.5.RELEASE/spring-boot-starter-jdbc-2.2.5.RELEASE.jar, file:/D:/repository/com/zaxxer/HikariCP/3.4.2/HikariCP-3.4.2.jar, file:/D:/repository/org/springframework/spring-jdbc/5.2.4.RELEASE/spring-jdbc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-tx/5.2.4.RELEASE/spring-tx-5.2.4.RELEASE.jar, file:/D:/repository/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar, file:/D:/repository/com/alibaba/druid/1.0.28/druid-1.0.28.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/jconsole.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/tools.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-starter-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter/2.2.2.RELEASE/spring-cloud-starter-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-rsa/1.0.9.RELEASE/spring-security-rsa-1.0.9.RELEASE.jar, file:/D:/repository/org/bouncycastle/bcpkix-jdk15on/1.64/bcpkix-jdk15on-1.64.jar, file:/D:/repository/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-hystrix/2.2.2.RELEASE/spring-cloud-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-aop/2.2.5.RELEASE/spring-boot-starter-aop-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/eureka/eureka-client/1.9.17/eureka-client-1.9.17.jar, file:/D:/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/D:/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar, file:/D:/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar, file:/D:/repository/joda-time/joda-time/2.10.5/joda-time-2.10.5.jar, file:/D:/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar, file:/D:/repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar, file:/D:/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/D:/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar, file:/D:/repository/com/netflix/archaius/archaius-core/0.7.6/archaius-core-0.7.6.jar, file:/D:/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/D:/repository/com/netflix/servo/servo-core/0.12.21/servo-core-0.12.21.jar, file:/D:/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/D:/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/D:/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/D:/repository/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar, file:/D:/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar, file:/D:/repository/commons-codec/commons-codec/1.14/commons-codec-1.14.jar, file:/D:/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar, file:/D:/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/D:/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-annotations/2.10.2/jackson-annotations-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-core/2.10.2/jackson-core-2.10.2.jar, file:/D:/repository/com/netflix/eureka/eureka-core/1.9.17/eureka-core-1.9.17.jar, file:/D:/repository/com/fasterxml/woodstox/woodstox-core/5.0.3/woodstox-core-5.0.3.jar, file:/D:/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-archaius/2.2.2.RELEASE/spring-cloud-starter-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-archaius/2.2.2.RELEASE/spring-cloud-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-ribbon/2.2.2.RELEASE/spring-cloud-starter-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/ribbon/ribbon/2.3.0/ribbon-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-transport/2.3.0/ribbon-transport-2.3.0.jar, file:/D:/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/D:/repository/com/netflix/ribbon/ribbon-core/2.3.0/ribbon-core-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-httpclient/2.3.0/ribbon-httpclient-2.3.0.jar, file:/D:/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-commons-util/0.3.0/netflix-commons-util-0.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-loadbalancer/2.3.0/ribbon-loadbalancer-2.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/D:/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-loadbalancer/2.2.2.RELEASE/spring-cloud-starter-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-loadbalancer/2.2.2.RELEASE/spring-cloud-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/io/projectreactor/reactor-core/3.3.3.RELEASE/reactor-core-3.3.3.RELEASE.jar, file:/D:/repository/io/projectreactor/addons/reactor-extra/3.3.2.RELEASE/reactor-extra-3.3.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-cache/2.2.5.RELEASE/spring-boot-starter-cache-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/spring-context-support/5.2.4.RELEASE/spring-context-support-5.2.4.RELEASE.jar, file:/D:/repository/com/stoyanr/evictor/1.0.0/evictor-1.0.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-eureka/2.3.0/ribbon-eureka-2.3.0.jar, file:/D:/repository/com/thoughtworks/xstream/xstream/1.4.12/xstream-1.4.12.jar, file:/D:/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/D:/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-hystrix/2.2.2.RELEASE/spring-cloud-starter-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-ribbon/2.2.2.RELEASE/spring-cloud-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/hystrix/hystrix-core/1.5.18/hystrix-core-1.5.18.jar, file:/D:/repository/org/hdrhistogram/HdrHistogram/2.1.9/HdrHistogram-2.1.9.jar, file:/D:/repository/com/netflix/hystrix/hystrix-serialization/1.5.18/hystrix-serialization-1.5.18.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-afterburner/2.10.2/jackson-module-afterburner-2.10.2.jar, file:/D:/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.5.18/hystrix-metrics-event-stream-1.5.18.jar, file:/D:/repository/com/netflix/hystrix/hystrix-javanica/1.5.18/hystrix-javanica-1.5.18.jar, file:/D:/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/D:/repository/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar, file:/D:/repository/com/google/guava/guava/28.2-android/guava-28.2-android.jar, file:/D:/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar, file:/D:/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar, file:/D:/repository/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar, file:/D:/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar, file:/D:/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar, file:/D:/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar, file:/D:/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-actuator/2.2.5.RELEASE/spring-boot-starter-actuator-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator-autoconfigure/2.2.5.RELEASE/spring-boot-actuator-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator/2.2.5.RELEASE/spring-boot-actuator-2.2.5.RELEASE.jar, file:/D:/repository/io/micrometer/micrometer-core/1.3.5/micrometer-core-1.3.5.jar, file:/D:/repository/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar, file:/D:/repository/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-context/2.2.3.RELEASE/spring-cloud-context-2.2.3.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-crypto/5.2.2.RELEASE/spring-security-crypto-5.2.2.RELEASE.jar, file:/D:/repository/cn/hutool/hutool-all/5.3.5/hutool-all-5.3.5.jar, file:/D:/repository/de/codecentric/spring-boot-admin-starter-client/2.2.3/spring-boot-admin-starter-client-2.2.3.jar, file:/D:/repository/de/codecentric/spring-boot-admin-client/2.2.3/spring-boot-admin-client-2.2.3.jar, file:/F:/soft/idea/idea/lib/idea_rt.jar, file:/F:/soft/idea/idea/plugins/java/lib/rt/debugger-agent.jar]

  .   ____          _            __ _ _
 /// / ___'_ __ _ _(_)_ __  __ _ / / / /
( ( )/___ | '_ | '_| | '_ // _` | / / / /
 ///  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_/__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.5.RELEASE)

11:00:50 [main] DEBUG c.c.f.a.s.b.ApolloApplicationContextInitializer - Apollo bootstrap config is not enabled for context org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@4f966719, started on Thu Jan 01 08:00:00 CST 1970, parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@f5c79a6, see property: ${apollo.bootstrap.enabled}
11:00:50 [main] INFO  com.nisbos.goods.GoodsApplication - No active profile set, falling back to default profiles: default

验证二

logback-spring.xml配置日志级别为info

<logger level="info" name="org.springframework.boot.autoconfigure.logging"  additivity="false">
        <appender-ref ref="console"/>
        <appender-ref ref="logFile" />
    </logger>

application.yml配置日志级别为debug

logging:
  org:
    springframework:
      boot:
        autoconfigure:
          logging: debug

启动查看控制台

11:26:41 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.cloud.util.random.CachedRandomPropertySourceAutoConfiguration'
11:26:51 [main] DEBUG o.s.b.c.l.ClasspathLoggingApplicationListener - Application started with classpath: [file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/charsets.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/deploy.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/access-bridge-64.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/cldrdata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/dnsns.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jaccess.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/jfxrt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/localedata.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/nashorn.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunec.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunjce_provider.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunmscapi.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/sunpkcs11.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/ext/zipfs.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/javaws.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jce.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfr.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jfxswt.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/jsse.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/management-agent.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/plugin.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/resources.jar, file:/F:/soft/jdk/jdk1.8.0_241/jre/lib/rt.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-biz/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-starter/2.2.5.RELEASE/spring-boot-starter-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot/2.2.5.RELEASE/spring-boot-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-logging/2.2.5.RELEASE/spring-boot-starter-logging-2.2.5.RELEASE.jar, file:/D:/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/D:/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/D:/repository/org/apache/logging/log4j/log4j-to-slf4j/2.12.1/log4j-to-slf4j-2.12.1.jar, file:/D:/repository/org/apache/logging/log4j/log4j-api/2.12.1/log4j-api-2.12.1.jar, file:/D:/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar, file:/D:/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar, file:/D:/repository/org/yaml/snakeyaml/1.25/snakeyaml-1.25.jar, file:/D:/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar, file:/D:/repository/org/springframework/spring-core/5.2.4.RELEASE/spring-core-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-jcl/5.2.4.RELEASE/spring-jcl-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-web/2.2.5.RELEASE/spring-boot-starter-web-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-json/2.2.5.RELEASE/spring-boot-starter-json-2.2.5.RELEASE.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-databind/2.10.2/jackson-databind-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.10.2/jackson-datatype-jdk8-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.10.2/jackson-datatype-jsr310-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.10.2/jackson-module-parameter-names-2.10.2.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-tomcat/2.2.5.RELEASE/spring-boot-starter-tomcat-2.2.5.RELEASE.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.31/tomcat-embed-core-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.31/tomcat-embed-el-9.0.31.jar, file:/D:/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.31/tomcat-embed-websocket-9.0.31.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-validation/2.2.5.RELEASE/spring-boot-starter-validation-2.2.5.RELEASE.jar, file:/D:/repository/jakarta/validation/jakarta.validation-api/2.0.2/jakarta.validation-api-2.0.2.jar, file:/D:/repository/org/hibernate/validator/hibernate-validator/6.0.18.Final/hibernate-validator-6.0.18.Final.jar, file:/D:/repository/org/jboss/logging/jboss-logging/3.4.1.Final/jboss-logging-3.4.1.Final.jar, file:/D:/repository/com/fasterxml/classmate/1.5.1/classmate-1.5.1.jar, file:/D:/repository/org/springframework/spring-web/5.2.4.RELEASE/spring-web-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-beans/5.2.4.RELEASE/spring-beans-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-webmvc/5.2.4.RELEASE/spring-webmvc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-aop/5.2.4.RELEASE/spring-aop-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-context/5.2.4.RELEASE/spring-context-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-expression/5.2.4.RELEASE/spring-expression-5.2.4.RELEASE.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-api/target/classes/, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-openfeign/2.2.2.RELEASE/spring-cloud-starter-openfeign-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-openfeign-core/2.2.2.RELEASE/spring-cloud-openfeign-core-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar, file:/D:/repository/io/github/openfeign/form/feign-form/3.8.0/feign-form-3.8.0.jar, file:/D:/repository/commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar, file:/D:/repository/commons-io/commons-io/2.6/commons-io-2.6.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-commons/2.2.2.RELEASE/spring-cloud-commons-2.2.2.RELEASE.jar, file:/D:/repository/io/github/openfeign/feign-core/10.7.4/feign-core-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-slf4j/10.7.4/feign-slf4j-10.7.4.jar, file:/D:/repository/io/github/openfeign/feign-hystrix/10.7.4/feign-hystrix-10.7.4.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-rpc-framework/target/classes/, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-common/nisbos-common-trace/target/classes/, file:/D:/repository/org/springframework/boot/spring-boot-configuration-processor/2.2.5.RELEASE/spring-boot-configuration-processor-2.2.5.RELEASE.jar, file:/D:/repository/com/dianping/cat/cat-client/3.0.0/cat-client-3.0.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-client/1.6.0/apollo-client-1.6.0.jar, file:/D:/repository/com/ctrip/framework/apollo/apollo-core/1.6.0/apollo-core-1.6.0.jar, file:/D:/repository/com/google/code/gson/gson/2.8.6/gson-2.8.6.jar, file:/D:/repository/org/mybatis/mybatis/3.5.3/mybatis-3.5.3.jar, file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-common/target/classes/, file:/D:/repository/org/apache/shiro/shiro-core/1.5.3/shiro-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-lang/1.5.3/shiro-lang-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-cache/1.5.3/shiro-cache-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-hash/1.5.3/shiro-crypto-hash-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-core/1.5.3/shiro-crypto-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-crypto-cipher/1.5.3/shiro-crypto-cipher-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-core/1.5.3/shiro-config-core-1.5.3.jar, file:/D:/repository/org/apache/shiro/shiro-config-ogdl/1.5.3/shiro-config-ogdl-1.5.3.jar, file:/D:/repository/commons-beanutils/commons-beanutils/1.9.4/commons-beanutils-1.9.4.jar, file:/D:/repository/org/apache/shiro/shiro-event/1.5.3/shiro-event-1.5.3.jar, file:/D:/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/repository/org/apache/commons/commons-lang3/3.9/commons-lang3-3.9.jar, file:/D:/repository/com/baomidou/mybatis-plus-boot-starter/3.3.1/mybatis-plus-boot-starter-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus/3.3.1/mybatis-plus-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-extension/3.3.1/mybatis-plus-extension-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-core/3.3.1/mybatis-plus-core-3.3.1.jar, file:/D:/repository/com/baomidou/mybatis-plus-annotation/3.3.1/mybatis-plus-annotation-3.3.1.jar, file:/D:/repository/com/github/jsqlparser/jsqlparser/3.1/jsqlparser-3.1.jar, file:/D:/repository/org/mybatis/mybatis-spring/2.0.3/mybatis-spring-2.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-autoconfigure/2.2.5.RELEASE/spring-boot-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-jdbc/2.2.5.RELEASE/spring-boot-starter-jdbc-2.2.5.RELEASE.jar, file:/D:/repository/com/zaxxer/HikariCP/3.4.2/HikariCP-3.4.2.jar, file:/D:/repository/org/springframework/spring-jdbc/5.2.4.RELEASE/spring-jdbc-5.2.4.RELEASE.jar, file:/D:/repository/org/springframework/spring-tx/5.2.4.RELEASE/spring-tx-5.2.4.RELEASE.jar, file:/D:/repository/mysql/mysql-connector-java/8.0.19/mysql-connector-java-8.0.19.jar, file:/D:/repository/com/alibaba/druid/1.0.28/druid-1.0.28.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/jconsole.jar, file:/F:/soft/jdk/jdk1.8.0_241/lib/tools.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-starter-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter/2.2.2.RELEASE/spring-cloud-starter-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-rsa/1.0.9.RELEASE/spring-security-rsa-1.0.9.RELEASE.jar, file:/D:/repository/org/bouncycastle/bcpkix-jdk15on/1.64/bcpkix-jdk15on-1.64.jar, file:/D:/repository/org/bouncycastle/bcprov-jdk15on/1.64/bcprov-jdk15on-1.64.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-hystrix/2.2.2.RELEASE/spring-cloud-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-aop/2.2.5.RELEASE/spring-boot-starter-aop-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-eureka-client/2.2.2.RELEASE/spring-cloud-netflix-eureka-client-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/eureka/eureka-client/1.9.17/eureka-client-1.9.17.jar, file:/D:/repository/org/codehaus/jettison/jettison/1.3.7/jettison-1.3.7.jar, file:/D:/repository/stax/stax-api/1.0.1/stax-api-1.0.1.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-eventbus/0.3.0/netflix-eventbus-0.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-infix/0.3.0/netflix-infix-0.3.0.jar, file:/D:/repository/commons-jxpath/commons-jxpath/1.3/commons-jxpath-1.3.jar, file:/D:/repository/joda-time/joda-time/2.10.5/joda-time-2.10.5.jar, file:/D:/repository/org/antlr/antlr-runtime/3.4/antlr-runtime-3.4.jar, file:/D:/repository/org/antlr/stringtemplate/3.2.1/stringtemplate-3.2.1.jar, file:/D:/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/D:/repository/org/apache/commons/commons-math/2.2/commons-math-2.2.jar, file:/D:/repository/com/netflix/archaius/archaius-core/0.7.6/archaius-core-0.7.6.jar, file:/D:/repository/javax/ws/rs/jsr311-api/1.1.1/jsr311-api-1.1.1.jar, file:/D:/repository/com/netflix/servo/servo-core/0.12.21/servo-core-0.12.21.jar, file:/D:/repository/com/sun/jersey/jersey-core/1.19.1/jersey-core-1.19.1.jar, file:/D:/repository/com/sun/jersey/jersey-client/1.19.1/jersey-client-1.19.1.jar, file:/D:/repository/com/sun/jersey/contribs/jersey-apache-client4/1.19.1/jersey-apache-client4-1.19.1.jar, file:/D:/repository/org/apache/httpcomponents/httpclient/4.5.12/httpclient-4.5.12.jar, file:/D:/repository/org/apache/httpcomponents/httpcore/4.4.13/httpcore-4.4.13.jar, file:/D:/repository/commons-codec/commons-codec/1.14/commons-codec-1.14.jar, file:/D:/repository/com/google/inject/guice/4.1.0/guice-4.1.0.jar, file:/D:/repository/javax/inject/javax.inject/1/javax.inject-1.jar, file:/D:/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-annotations/2.10.2/jackson-annotations-2.10.2.jar, file:/D:/repository/com/fasterxml/jackson/core/jackson-core/2.10.2/jackson-core-2.10.2.jar, file:/D:/repository/com/netflix/eureka/eureka-core/1.9.17/eureka-core-1.9.17.jar, file:/D:/repository/com/fasterxml/woodstox/woodstox-core/5.0.3/woodstox-core-5.0.3.jar, file:/D:/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-archaius/2.2.2.RELEASE/spring-cloud-starter-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-archaius/2.2.2.RELEASE/spring-cloud-netflix-archaius-2.2.2.RELEASE.jar, file:/D:/repository/commons-configuration/commons-configuration/1.10/commons-configuration-1.10.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-ribbon/2.2.2.RELEASE/spring-cloud-starter-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/ribbon/ribbon/2.3.0/ribbon-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-transport/2.3.0/ribbon-transport-2.3.0.jar, file:/D:/repository/io/reactivex/rxnetty-contexts/0.4.9/rxnetty-contexts-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty-servo/0.4.9/rxnetty-servo-0.4.9.jar, file:/D:/repository/io/reactivex/rxnetty/0.4.9/rxnetty-0.4.9.jar, file:/D:/repository/com/netflix/ribbon/ribbon-core/2.3.0/ribbon-core-2.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-httpclient/2.3.0/ribbon-httpclient-2.3.0.jar, file:/D:/repository/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-commons-util/0.3.0/netflix-commons-util-0.3.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-loadbalancer/2.3.0/ribbon-loadbalancer-2.3.0.jar, file:/D:/repository/com/netflix/netflix-commons/netflix-statistics/0.1.1/netflix-statistics-0.1.1.jar, file:/D:/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-loadbalancer/2.2.2.RELEASE/spring-cloud-starter-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-loadbalancer/2.2.2.RELEASE/spring-cloud-loadbalancer-2.2.2.RELEASE.jar, file:/D:/repository/io/projectreactor/reactor-core/3.3.3.RELEASE/reactor-core-3.3.3.RELEASE.jar, file:/D:/repository/io/projectreactor/addons/reactor-extra/3.3.2.RELEASE/reactor-extra-3.3.2.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-cache/2.2.5.RELEASE/spring-boot-starter-cache-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/spring-context-support/5.2.4.RELEASE/spring-context-support-5.2.4.RELEASE.jar, file:/D:/repository/com/stoyanr/evictor/1.0.0/evictor-1.0.0.jar, file:/D:/repository/com/netflix/ribbon/ribbon-eureka/2.3.0/ribbon-eureka-2.3.0.jar, file:/D:/repository/com/thoughtworks/xstream/xstream/1.4.12/xstream-1.4.12.jar, file:/D:/repository/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.jar, file:/D:/repository/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-starter-netflix-hystrix/2.2.2.RELEASE/spring-cloud-starter-netflix-hystrix-2.2.2.RELEASE.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-netflix-ribbon/2.2.2.RELEASE/spring-cloud-netflix-ribbon-2.2.2.RELEASE.jar, file:/D:/repository/com/netflix/hystrix/hystrix-core/1.5.18/hystrix-core-1.5.18.jar, file:/D:/repository/org/hdrhistogram/HdrHistogram/2.1.9/HdrHistogram-2.1.9.jar, file:/D:/repository/com/netflix/hystrix/hystrix-serialization/1.5.18/hystrix-serialization-1.5.18.jar, file:/D:/repository/com/fasterxml/jackson/module/jackson-module-afterburner/2.10.2/jackson-module-afterburner-2.10.2.jar, file:/D:/repository/com/netflix/hystrix/hystrix-metrics-event-stream/1.5.18/hystrix-metrics-event-stream-1.5.18.jar, file:/D:/repository/com/netflix/hystrix/hystrix-javanica/1.5.18/hystrix-javanica-1.5.18.jar, file:/D:/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar, file:/D:/repository/org/aspectj/aspectjweaver/1.9.5/aspectjweaver-1.9.5.jar, file:/D:/repository/com/google/guava/guava/28.2-android/guava-28.2-android.jar, file:/D:/repository/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar, file:/D:/repository/com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar, file:/D:/repository/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.jar, file:/D:/repository/com/google/errorprone/error_prone_annotations/2.3.4/error_prone_annotations-2.3.4.jar, file:/D:/repository/com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar, file:/D:/repository/io/reactivex/rxjava-reactive-streams/1.2.1/rxjava-reactive-streams-1.2.1.jar, file:/D:/repository/org/reactivestreams/reactive-streams/1.0.3/reactive-streams-1.0.3.jar, file:/D:/repository/org/springframework/boot/spring-boot-starter-actuator/2.2.5.RELEASE/spring-boot-starter-actuator-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator-autoconfigure/2.2.5.RELEASE/spring-boot-actuator-autoconfigure-2.2.5.RELEASE.jar, file:/D:/repository/org/springframework/boot/spring-boot-actuator/2.2.5.RELEASE/spring-boot-actuator-2.2.5.RELEASE.jar, file:/D:/repository/io/micrometer/micrometer-core/1.3.5/micrometer-core-1.3.5.jar, file:/D:/repository/org/latencyutils/LatencyUtils/2.0.3/LatencyUtils-2.0.3.jar, file:/D:/repository/org/projectlombok/lombok/1.18.12/lombok-1.18.12.jar, file:/D:/repository/org/springframework/cloud/spring-cloud-context/2.2.3.RELEASE/spring-cloud-context-2.2.3.RELEASE.jar, file:/D:/repository/org/springframework/security/spring-security-crypto/5.2.2.RELEASE/spring-security-crypto-5.2.2.RELEASE.jar, file:/D:/repository/cn/hutool/hutool-all/5.3.5/hutool-all-5.3.5.jar, file:/D:/repository/de/codecentric/spring-boot-admin-starter-client/2.2.3/spring-boot-admin-starter-client-2.2.3.jar, file:/D:/repository/de/codecentric/spring-boot-admin-client/2.2.3/spring-boot-admin-client-2.2.3.jar, file:/F:/soft/idea/idea/lib/idea_rt.jar, file:/F:/soft/idea/idea/plugins/java/lib/rt/debugger-agent.jar]

  .   ____          _            __ _ _
 /// / ___'_ __ _ _(_)_ __  __ _ / / / /
( ( )/___ | '_ | '_| | '_ // _` | / / / /
 ///  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_/__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.2.5.RELEASE)

11:26:51 [main] DEBUG c.c.f.a.s.b.ApolloApplicationContextInitializer - Apollo bootstrap config is not enabled for context org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1eb2d371, started on Thu Jan 01 08:00:00 CST 1970, parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@669253b7, see property: ${apollo.bootstrap.enabled}
11:26:51 [main] INFO  com.nisbos.goods.GoodsApplication - No active profile set, falling back to default profiles: default
11:26:51 [main] DEBUG o.s.boot.SpringApplication - Loading source class com.nisbos.goods.GoodsApplication,class org.springframework.cloud.bootstrap.BootstrapApplicationListener$BootstrapMarkerConfiguration
11:26:51 [main] DEBUG o.s.b.c.c.ConfigFileApplicationListener - Loaded config file 'file:/E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-biz/target/classes/application.yml' (classpath:/application.yml)
11:26:51 [main] DEBUG o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@1eb2d371
11:26:51 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
11:26:51 [main] DEBUG o.s.b.f.s.DefaultListableBeanFactory - Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory'
11:26:51 [main] DEBUG o.s.c.a.ClassPathBeanDefinitionScanner - Identified candidate component class: file [E:/nisbos-cloud/nisbos-springcloud/nisbos-springcloud-example/nisbos-springcloud-example-goods/nisbos-springcloud-example-goods-biz/target/classes/com/nisbos/goods/controller/EgGoodsController.class]

3、当项目中同时存在logback.xml和application.yml,同种类包日志级别配置以哪个为准?

以logback.xml配置的日志级别为准

这个就不贴验证过程了

结论

当项目中同时在application.yml和logback.xml、logback-spring.xml配置同种类包日志级别时,以logback-spring.xml、logback.xml配置的日志级别为准

延展

细心的朋友可能会发现我分别用logback-spring.xml、logback.xml来验证。那logback-spring.xml和logback.xml这两种文件到底有什么区别?

springboot2启动信息去除CONDITIONS EVALUATION REPORT后引发的思考

springboot2启动信息去除CONDITIONS EVALUATION REPORT后引发的思考

上面的图片来源于springboot官网,从图片我们可以得到几点信息,springboot官方推荐使用logback-spring.xml。理由是如果是用logback.xml,在标准的日志存放的地方(比如src/main/resource),spring将无法完全控制日志的初始化。其次如果使用logback.xml,则没法使用springboot提供的一些扩展功能。比如你在logback.xml使用springProperty或者springProfile标签时,将无法得到预期的效果

总结

其实我第一次在配置

logging.level.org.springframework.boot.autoconfigure: info

没法去除启动时输出自动装配日志报告后,也曾利用搜索引擎寻找答案。然后得到的答案如下:

springboot2启动信息去除CONDITIONS EVALUATION REPORT后引发的思考

而且不止一篇都是说这么配置。但我依然很固执没按搜索引擎那样的说,把日志级别调成ERROR。原因是我们 控制台保留完整的案发现场 ,他输出日志级别是debug,因此日志级别调整成debug级别以上就行。

说这么一段,除了想装逼一下,更重要的是表达有时候控制台输出的东西其实已经告诉你破案的关键了。

原文  https://segmentfault.com/a/1190000023241261
正文到此结束
Loading...