java - Spring boot 启动时的调试日志跟踪

标签 java spring-boot logging spring-cloud logback

几天前,我将 Spring 云依赖项(openfeign 等)添加到我的 Spring Boot 应用程序中。
应用程序突然开始在启动时写入日志跟踪,如下所示:

2019-11-22 12:22:49,363 [DEBUG] org.springframework.boot.context.logging.ClasspathLoggingApplicationListener  Application started with classpath: [file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/charsets.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/deploy.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/access-bridge-64.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/cldrdata.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/dnsns.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/jaccess.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/jfxrt.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/localedata.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/nashorn.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/sunec.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/sunjce_provider.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/sunmscapi.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/sunpkcs11.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/ext/zipfs.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/javaws.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/jce.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/jfr.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/jfxswt.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/jsse.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/management-agent.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/plugin.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/resources.jar, file:/C:/Program%20Files/Java/jdk1.8.0_151/jre/lib/rt.jar, file:/D:/Proyectos/PetApp/Back/PetApp_Core/target/classes/, file:/D:/Proyectos/PetApp/Back/PetApp_ModelLib/target/classes/, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-data-jpa/2.1.6.RELEASE/spring-boot-starter-data-jpa-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-aop/2.1.6.RELEASE/spring-boot-starter-aop-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/aspectj/aspectjweaver/1.9.4/aspectjweaver-1.9.4.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-jdbc/2.1.6.RELEASE/spring-boot-starter-jdbc-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/com/zaxxer/HikariCP/3.2.0/HikariCP-3.2.0.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-jdbc/5.1.8.RELEASE/spring-jdbc-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/javax/transaction/javax.transaction-api/1.3/javax.transaction-api-1.3.jar, file:/D:/Tools/.m2/repository/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar, file:/D:/Tools/.m2/repository/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar, file:/D:/Tools/.m2/repository/org/hibernate/hibernate-core/5.3.10.Final/hibernate-core-5.3.10.Final.jar, file:/D:/Tools/.m2/repository/org/jboss/logging/jboss-logging/3.3.2.Final/jboss-logging-3.3.2.Final.jar, file:/D:/Tools/.m2/repository/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar, file:/D:/Tools/.m2/repository/org/javassist/javassist/3.23.2-GA/javassist-3.23.2-GA.jar, file:/D:/Tools/.m2/repository/net/bytebuddy/byte-buddy/1.9.13/byte-buddy-1.9.13.jar, file:/D:/Tools/.m2/repository/antlr/antlr/2.7.7/antlr-2.7.7.jar, file:/D:/Tools/.m2/repository/org/jboss/jandex/2.0.5.Final/jandex-2.0.5.Final.jar, file:/D:/Tools/.m2/repository/org/dom4j/dom4j/2.1.1/dom4j-2.1.1.jar, file:/D:/Tools/.m2/repository/org/hibernate/common/hibernate-commons-annotations/5.0.4.Final/hibernate-commons-annotations-5.0.4.Final.jar, file:/D:/Tools/.m2/repository/org/springframework/data/spring-data-jpa/2.1.9.RELEASE/spring-data-jpa-2.1.9.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/data/spring-data-commons/2.1.9.RELEASE/spring-data-commons-2.1.9.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-orm/5.1.8.RELEASE/spring-orm-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-context/5.1.8.RELEASE/spring-context-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-tx/5.1.8.RELEASE/spring-tx-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-beans/5.1.8.RELEASE/spring-beans-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-aspects/5.1.8.RELEASE/spring-aspects-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-security/2.1.6.RELEASE/spring-boot-starter-security-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter/2.1.6.RELEASE/spring-boot-starter-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot/2.1.6.RELEASE/spring-boot-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.1.6.RELEASE/spring-boot-autoconfigure-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-logging/2.1.6.RELEASE/spring-boot-starter-logging-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/ch/qos/logback/logback-classic/1.2.3/logback-classic-1.2.3.jar, file:/D:/Tools/.m2/repository/ch/qos/logback/logback-core/1.2.3/logback-core-1.2.3.jar, file:/D:/Tools/.m2/repository/org/apache/logging/log4j/log4j-to-slf4j/2.11.2/log4j-to-slf4j-2.11.2.jar, file:/D:/Tools/.m2/repository/org/apache/logging/log4j/log4j-api/2.11.2/log4j-api-2.11.2.jar, file:/D:/Tools/.m2/repository/org/slf4j/jul-to-slf4j/1.7.26/jul-to-slf4j-1.7.26.jar, file:/D:/Tools/.m2/repository/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar, file:/D:/Tools/.m2/repository/org/yaml/snakeyaml/1.23/snakeyaml-1.23.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-aop/5.1.8.RELEASE/spring-aop-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/security/spring-security-config/5.1.5.RELEASE/spring-security-config-5.1.5.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/security/spring-security-web/5.1.5.RELEASE/spring-security-web-5.1.5.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-expression/5.1.8.RELEASE/spring-expression-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.1.6.RELEASE/spring-boot-starter-web-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.1.6.RELEASE/spring-boot-starter-json-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.9.9/jackson-datatype-jdk8-2.9.9.jar, file:/D:/Tools/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.9.9/jackson-datatype-jsr310-2.9.9.jar, file:/D:/Tools/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.9.9/jackson-module-parameter-names-2.9.9.jar, file:/D:/Tools/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.1.6.RELEASE/spring-boot-starter-tomcat-2.1.6.RELEASE.jar, file:/D:/Tools/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.21/tomcat-embed-core-9.0.21.jar, file:/D:/Tools/.m2/repository/org/apache/tomcat/embed/tomcat-embed-el/9.0.21/tomcat-embed-el-9.0.21.jar, file:/D:/Tools/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.21/tomcat-embed-websocket-9.0.21.jar, file:/D:/Tools/.m2/repository/org/hibernate/validator/hibernate-validator/6.0.17.Final/hibernate-validator-6.0.17.Final.jar, file:/D:/Tools/.m2/repository/javax/validation/validation-api/2.0.1.Final/validation-api-2.0.1.Final.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-web/5.1.8.RELEASE/spring-web-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-webmvc/5.1.8.RELEASE/spring-webmvc-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/cloud/spring-cloud-starter-openfeign/2.1.3.RELEASE/spring-cloud-starter-openfeign-2.1.3.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/cloud/spring-cloud-starter/2.1.3.RELEASE/spring-cloud-starter-2.1.3.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/cloud/spring-cloud-context/2.1.3.RELEASE/spring-cloud-context-2.1.3.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/security/spring-security-rsa/1.0.7.RELEASE/spring-security-rsa-1.0.7.RELEASE.jar, file:/D:/Tools/.m2/repository/org/bouncycastle/bcpkix-jdk15on/1.60/bcpkix-jdk15on-1.60.jar, file:/D:/Tools/.m2/repository/org/bouncycastle/bcprov-jdk15on/1.60/bcprov-jdk15on-1.60.jar, file:/D:/Tools/.m2/repository/org/springframework/cloud/spring-cloud-openfeign-core/2.1.3.RELEASE/spring-cloud-openfeign-core-2.1.3.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/cloud/spring-cloud-netflix-ribbon/2.1.3.RELEASE/spring-cloud-netflix-ribbon-2.1.3.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/cloud/spring-cloud-netflix-archaius/2.1.3.RELEASE/spring-cloud-netflix-archaius-2.1.3.RELEASE.jar, file:/D:/Tools/.m2/repository/io/github/openfeign/form/feign-form-spring/3.8.0/feign-form-spring-3.8.0.jar, file:/D:/Tools/.m2/repository/io/github/openfeign/form/feign-form/3.8.0/feign-form-3.8.0.jar, file:/D:/Tools/.m2/repository/commons-fileupload/commons-fileupload/1.4/commons-fileupload-1.4.jar, file:/D:/Tools/.m2/repository/commons-io/commons-io/2.2/commons-io-2.2.jar, file:/D:/Tools/.m2/repository/org/springframework/cloud/spring-cloud-commons/2.1.3.RELEASE/spring-cloud-commons-2.1.3.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/security/spring-security-crypto/5.1.5.RELEASE/spring-security-crypto-5.1.5.RELEASE.jar, file:/D:/Tools/.m2/repository/io/github/openfeign/feign-core/10.2.3/feign-core-10.2.3.jar, file:/D:/Tools/.m2/repository/io/github/openfeign/feign-slf4j/10.2.3/feign-slf4j-10.2.3.jar, file:/D:/Tools/.m2/repository/io/github/openfeign/feign-hystrix/10.2.3/feign-hystrix-10.2.3.jar, file:/D:/Tools/.m2/repository/com/netflix/archaius/archaius-core/0.7.6/archaius-core-0.7.6.jar, file:/D:/Tools/.m2/repository/com/google/code/findbugs/jsr305/3.0.1/jsr305-3.0.1.jar, file:/D:/Tools/.m2/repository/commons-configuration/commons-configuration/1.8/commons-configuration-1.8.jar, file:/D:/Tools/.m2/repository/commons-lang/commons-lang/2.6/commons-lang-2.6.jar, file:/D:/Tools/.m2/repository/com/netflix/hystrix/hystrix-core/1.5.18/hystrix-core-1.5.18.jar, file:/D:/Tools/.m2/repository/io/reactivex/rxjava/1.3.8/rxjava-1.3.8.jar, file:/D:/Tools/.m2/repository/org/hdrhistogram/HdrHistogram/2.1.9/HdrHistogram-2.1.9.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-test/5.1.8.RELEASE/spring-test-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-core/5.1.8.RELEASE/spring-core-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/spring-jcl/5.1.8.RELEASE/spring-jcl-5.1.8.RELEASE.jar, file:/D:/Tools/.m2/repository/mysql/mysql-connector-java/8.0.16/mysql-connector-java-8.0.16.jar, file:/D:/Tools/.m2/repository/org/postgresql/postgresql/42.2.5/postgresql-42.2.5.jar, file:/D:/Tools/.m2/repository/com/h2database/h2/1.4.199/h2-1.4.199.jar, file:/D:/Tools/.m2/repository/org/springframework/security/spring-security-core/5.1.5.RELEASE/spring-security-core-5.1.5.RELEASE.jar, file:/D:/Tools/.m2/repository/com/cloudinary/cloudinary-http44/1.24.0/cloudinary-http44-1.24.0.jar, file:/D:/Tools/.m2/repository/com/cloudinary/cloudinary-core/1.24.0/cloudinary-core-1.24.0.jar, file:/D:/Tools/.m2/repository/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar, file:/D:/Tools/.m2/repository/org/apache/httpcomponents/httpclient/4.5.9/httpclient-4.5.9.jar, file:/D:/Tools/.m2/repository/org/apache/httpcomponents/httpcore/4.4.11/httpcore-4.4.11.jar, file:/D:/Tools/.m2/repository/org/apache/httpcomponents/httpmime/4.5.9/httpmime-4.5.9.jar, file:/D:/Tools/.m2/repository/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar, file:/D:/Tools/.m2/repository/org/assertj/assertj-core/3.11.1/assertj-core-3.11.1.jar, file:/D:/Tools/.m2/repository/com/auth0/java-jwt/3.3.0/java-jwt-3.3.0.jar, file:/D:/Tools/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.9.9/jackson-databind-2.9.9.jar, file:/D:/Tools/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.9.0/jackson-annotations-2.9.0.jar, file:/D:/Tools/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.9.9/jackson-core-2.9.9.jar, file:/D:/Tools/.m2/repository/commons-codec/commons-codec/1.11/commons-codec-1.11.jar, file:/D:/Tools/.m2/repository/io/springfox/springfox-swagger2/2.9.2/springfox-swagger2-2.9.2.jar, file:/D:/Tools/.m2/repository/io/swagger/swagger-annotations/1.5.20/swagger-annotations-1.5.20.jar, file:/D:/Tools/.m2/repository/io/swagger/swagger-models/1.5.20/swagger-models-1.5.20.jar, file:/D:/Tools/.m2/repository/io/springfox/springfox-spi/2.9.2/springfox-spi-2.9.2.jar, file:/D:/Tools/.m2/repository/io/springfox/springfox-core/2.9.2/springfox-core-2.9.2.jar, file:/D:/Tools/.m2/repository/io/springfox/springfox-schema/2.9.2/springfox-schema-2.9.2.jar, file:/D:/Tools/.m2/repository/io/springfox/springfox-swagger-common/2.9.2/springfox-swagger-common-2.9.2.jar, file:/D:/Tools/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar, file:/D:/Tools/.m2/repository/com/google/guava/guava/20.0/guava-20.0.jar, file:/D:/Tools/.m2/repository/com/fasterxml/classmate/1.4.0/classmate-1.4.0.jar, file:/D:/Tools/.m2/repository/org/slf4j/slf4j-api/1.7.26/slf4j-api-1.7.26.jar, file:/D:/Tools/.m2/repository/org/springframework/plugin/spring-plugin-core/1.2.0.RELEASE/spring-plugin-core-1.2.0.RELEASE.jar, file:/D:/Tools/.m2/repository/org/springframework/plugin/spring-plugin-metadata/1.2.0.RELEASE/spring-plugin-metadata-1.2.0.RELEASE.jar, file:/D:/Tools/.m2/repository/org/mapstruct/mapstruct/1.2.0.Final/mapstruct-1.2.0.Final.jar, file:/D:/Tools/.m2/repository/io/springfox/springfox-swagger-ui/2.9.2/springfox-swagger-ui-2.9.2.jar, file:/D:/app/IntelliJ%20IDEA%20Community%20Edition%202018.2.7/lib/idea_rt.jar]
2019-11-22 12:22:49,645 [DEBUG] org.springframework.boot.SpringApplication  Loading source class org.springframework.cloud.bootstrap.BootstrapImportSelectorConfiguration
2019-11-22 12:22:49,704 [DEBUG] org.springframework.context.support.AbstractApplicationContext  Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2e005c4b
2019-11-22 12:22:49,741 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.context.annotation.internalConfigurationAnnotationProcessor'
2019-11-22 12:22:49,776 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory'
2019-11-22 12:22:49,990 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.condition.BeanTypeRegistry'
2019-11-22 12:22:50,142 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'propertySourcesPlaceholderConfigurer'
2019-11-22 12:22:50,154 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerProcessor'
2019-11-22 12:22:50,155 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.boot.context.properties.ConfigurationBeanFactoryMetadata'
2019-11-22 12:22:50,156 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.context.event.internalEventListenerFactory'
2019-11-22 12:22:50,159 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.context.annotation.internalAutowiredAnnotationProcessor'
2019-11-22 12:22:50,160 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.context.annotation.internalCommonAnnotationProcessor'
2019-11-22 12:22:50,164 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.context.annotation.internalPersistenceAnnotationProcessor'
2019-11-22 12:22:50,164 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor'
2019-11-22 12:22:50,169 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'configurationPropertiesBeans'
2019-11-22 12:22:50,170 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration'
2019-11-22 12:22:50,179 [INFO ] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker  Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$a7e4833f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-22 12:22:50,208 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'bootstrapImportSelectorConfiguration'
2019-11-22 12:22:50,210 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration'
2019-11-22 12:22:50,224 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'spring.cloud.config-org.springframework.cloud.bootstrap.config.PropertySourceBootstrapProperties'
2019-11-22 12:22:50,239 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.cloud.bootstrap.encrypt.EncryptionBootstrapConfiguration'
2019-11-22 12:22:50,242 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'encrypt-org.springframework.cloud.bootstrap.encrypt.KeyProperties'
2019-11-22 12:22:50,245 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'environmentDecryptApplicationListener'
2019-11-22 12:22:50,256 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'configurationPropertiesRebinder'
2019-11-22 12:22:50,260 [DEBUG] org.springframework.beans.factory.support.ConstructorResolver  Autowiring by type from bean name 'configurationPropertiesRebinder' via factory method to bean named 'configurationPropertiesBeans'
2019-11-22 12:22:50,273 [DEBUG] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry  Creating shared instance of singleton bean 'org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration'
2019-11-22 12:22:50,298 [DEBUG] org.springframework.boot.autoconfigure.logging.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)


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

    None


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

    None



###########################################################
__________        __    __     _____ ____________________
\______   \ _____/  |__/  |_  /  _  \\______   \______   \
 |     ___// __ \   __\   __\/  /_\  \|     ___/|     ___/
 |    |   \  ___/|  |  |  | /    |    \    |    |    |
 |____|    \___  >__|  |__| \____|__  /____|    |____|
               \/                   \/
                                                PetApp Core
###########################################################

2019-11-22 12:22:51,844 [INFO ] org.springframework.boot.SpringApplication  No active profile set, falling back to default profiles: default
2019-11-22 12:23:00,248 [INFO ] com.mashosoft.petapp.core.config.DDBB.DDBBConfig  H2 DDBB selected
如您所见,它在 startUp 上编写了大量调试跟踪,并且在横幅之后,日志运行良好。
我的 logback-spring.xml 是这样的:
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false">

    <appender name="Console" class="ch.qos.logback.core.ConsoleAppender">
        <layout class="ch.qos.logback.classic.PatternLayout">
            <Pattern>%green(%d{ISO8601}) [%highlight(%-5level)] %yellow(%C{1.}) %magenta(%X{requestKey}) %msg%n%throwable</Pattern>
        </layout>
    </appender>

    <logger name="org.springframework" level="${logging.level.org.springframework}" additivity="false">
        <appender-ref ref="Console" />
    </logger>
    <logger name="com.mashosoft.petapp.orchestrator" level="${logging.level.orchestrator}" additivity="false">
        <appender-ref ref="Console" />
    </logger>
    <Root level="${logging.level.ROOT}">
        <appender-ref ref="Console" />
    </Root>

</configuration>
我的 application.properties 中有 3 个属性
# Log properties in application.properties
logging.level.orchestrator=INFO
logging.level.org.springframework=ERROR
logging.level.ROOT=OFF
我无法让这些痕迹消失,因为它们非常烦人,而且我的其他应用程序每次启动应用程序时都不会显示它们。
我还添加了一个 Spring Boot 管理服务器和客户端,我可以看到所有 org.springframework 跟踪都设置为错误。
Everuthing 在添加 spring-cloud 时开始
<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.6.RELEASE</version>
        <relativePath/>
    </parent>

<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Greenwich.SR3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <!--PETAPP-->
        <dependency>
            <groupId>com.mashosoft.petapp</groupId>
            <artifactId>PetAppModelLib</artifactId>
            <version>V-0.0.0</version>
        </dependency>

        <!--SPRING-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId>
        </dependency>
如果我设置了 -Dlogging.level.org.springframework=OFF 它就完美了。
###########################################################
__________        __    __     _____ ____________________
\______   \ _____/  |__/  |_  /  _  \\______   \______   \
 |     ___// __ \   __\   __\/  /_\  \|     ___/|     ___/
 |    |   \  ___/|  |  |  | /    |    \    |    |    |
 |____|    \___  >__|  |__| \____|__  /____|    |____|
               \/                   \/
                                                PetApp Core
###########################################################

2019-11-30 13:12:55,391 [INFO ] org.springframework.boot.SpringApplication  The following profiles are active: local
2019-11-30 13:13:05,102 [INFO ] org.springframework.boot.StartupInfoLogger  Started PetAppApiGatewayApplication in 13.05 seconds (JVM running for 13.743)
如果我直接在 logback-spring.xml 中设置级别,例如:
<logger name="org.hibernate" level="error" additivity="false">
        <appender-ref ref="Console" />
    </logger>
    <logger name="org.springframework" level="error" additivity="false">
        <appender-ref ref="Console" />
    </logger>
它没有显示第一个痕迹,而是显示另一个
###########################################################
__________        __    __     _____ ____________________
\______   \ _____/  |__/  |_  /  _  \\______   \______   \
 |     ___// __ \   __\   __\/  /_\  \|     ___/|     ___/
 |    |   \  ___/|  |  |  | /    |    \    |    |    |
 |____|    \___  >__|  |__| \____|__  /____|    |____|
               \/                   \/
                                                PetApp Core
###########################################################

2019-11-30 13:11:13,079 [INFO ] org.springframework.boot.SpringApplication  The following profiles are active: local
2019-11-30 13:11:14,470 [WARN ] org.springframework.boot.actuate.endpoint.EndpointId  Endpoint ID 'hystrix.stream' contains invalid characters, please migrate to a valid format.
2019-11-30 13:11:14,803 [INFO ] org.springframework.cloud.context.scope.GenericScope  BeanFactory id=105fdd6b-1452-33a9-a76c-73ca1dbb84c7
2019-11-30 13:11:15,079 [INFO ] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker  Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$29974e55] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-11-30 13:11:16,247 [INFO ] org.springframework.boot.web.embedded.tomcat.TomcatWebServer  Tomcat initialized with port(s): 8088 (http)
2019-11-30 13:11:16,460 [INFO ] org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext  Root WebApplicationContext: initialization completed in 3361 ms
2019-11-30 13:11:18,260 [WARN ] org.springframework.boot.devtools.autoconfigure.RemoteDevToolsAutoConfiguration$RemoteRestartConfiguration  Listening for remote restart updates on /PetApp/.~~spring-boot!~/restart
2019-11-30 13:11:18,942 [INFO ] org.springframework.boot.actuate.endpoint.web.EndpointLinksResolver  Exposing 2 endpoint(s) beneath base path '/actuator'
2019-11-30 13:11:19,081 [WARN ] org.springframework.cloud.netflix.archaius.ArchaiusAutoConfiguration  No spring.application.name found, defaulting to 'application'
2019-11-30 13:11:19,287 [INFO ] org.springframework.scheduling.concurrent.ExecutorConfigurationSupport  Initializing ExecutorService 'applicationTaskExecutor'
2019-11-30 13:11:19,327 [INFO ] org.springframework.boot.devtools.autoconfigure.OptionalLiveReloadServer  LiveReload server is running on port 35729
2019-11-30 13:11:20,684 [INFO ] org.springframework.cloud.netflix.zuul.ZuulFilterInitializer  Starting filter initializer
2019-11-30 13:11:21,174 [INFO ] org.springframework.boot.web.embedded.tomcat.TomcatWebServer  Tomcat started on port(s): 8088 (http) with context path '/PetApp'
2019-11-30 13:11:22,456 [INFO ] org.springframework.boot.StartupInfoLogger  Started PetAppApiGatewayApplication in 12.914 seconds (JVM running for 13.631)

最佳答案

我没有足够的信息来明确说明这一点,但不知何故,某处有一个 application.yml 或 application.properties 文件,其中包含 debug: true放。

这个神奇的属性会做两件事。首先,它将使用 DEBUG 覆盖所有日志记录级别。其次,它会在输出的底部显示一长串正匹配和负匹配。您可能想查看 What Does The Spring Boot "debug" Config Property Set?有关详细信息,但您可以通过设置 debug: false 来测试这一点。在您的根 application.yml文件。其他一切都按照您希望的方式进行设置。如果意外的调试消息消失了,那就是您的答案。我不知道您包含哪些依赖项,但是如果您自己没有设置,其中之一必须设置了该属性。

关于java - Spring boot 启动时的调试日志跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59027134/

相关文章:

java - 使用像素 int[] 创建 BufferedImage

java - 尊重 Java/Swing 中的字体连字

java - 我们可以完全避免使用 Scala 并简单地使用 Play!框架

java - Whitelabel错误页面部署到服务器后出现错误

java - Hibernate 使用 apache commons 日志记录和 slf4j - 为什么需要 2 个日志记录抽象层?

java - 无法理解使用 for 循环的部分代码?

java - SpringBoot Redis 远程主机

java - Spring 找不到类路径中 * 的驱动程序类

python - 设置 python 日志记录到标准输出的最简单方法

c# - Windows Phone 8 开发 - 日志记录和 IOC 设计模式