Skip to content

针对Docker版本的apollo-quick-start来集成spring-boot-logger的问题 #21

@Jiiiiiin

Description

@Jiiiiiin

问题描述:

  • 测试机器本地mac os
  • 先启动Apollo Quick Start Docker部署服务,按照文档所属
  • 接着在portal按照apollo-use-cases/spring-boot-loggerREADME.md创建应用和配置
  • 启动应用,日志如下:
 :: Spring Boot ::        (v2.0.3.RELEASE)

2019-03-23 21:22:17.407  INFO 97534 --- [           main] c.c.f.a.u.c.s.boot.logger.Application    : Starting Application on jiiiiiins-MacBook-Pro.local with PID 97534 (/Users/jiiiiiin/Documents/GitHub/apollo-use-cases/spring-boot-logger/target/classes started by jiiiiiin in /Users/jiiiiiin/Documents/GitHub/apollo-use-cases)
2019-03-23 21:22:17.411  INFO 97534 --- [           main] c.c.f.a.u.c.s.boot.logger.Application    : No active profile set, falling back to default profiles: default
2019-03-23 21:22:17.462  INFO 97534 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1fc32e4f: startup date [Sat Mar 23 21:22:17 CST 2019]; root of context hierarchy
2019-03-23 21:22:17.839  INFO 97534 --- [           main] c.c.f.f.i.p.DefaultApplicationProvider   : App ID is set to spring-boot-logger by app.id property from System Property
2019-03-23 21:22:17.840  INFO 97534 --- [           main] c.c.f.f.i.p.DefaultServerProvider        : Environment is set to null. Because it is not available in either (1) JVM system property 'env', (2) OS env variable 'ENV' nor (3) property 'env' from the properties InputStream.
2019-03-23 21:22:17.991  INFO 97534 --- [           main] c.c.f.a.i.DefaultMetaServerProvider      : Located meta services from apollo.meta configuration: http://localhost:8080!
2019-03-23 21:22:17.994  INFO 97534 --- [           main] c.c.f.apollo.core.MetaDomainConsts       : Located meta server address http://localhost:8080 for env UNKNOWN from com.ctrip.framework.apollo.internals.DefaultMetaServerProvider
2019-03-23 21:22:23.048  WARN 97534 --- [           main] c.c.f.a.i.RemoteConfigRepository         : Load config failed, will retry in 1 SECONDS. appId: spring-boot-logger, cluster: default, namespaces: application
2019-03-23 21:22:29.057  WARN 97534 --- [           main] c.c.f.a.i.AbstractConfigRepository       : Sync config failed, will retry. Repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository, reason: Load Apollo Config failed - appId: spring-boot-logger, cluster: default, namespace: application, url: http://172.18.0.4:8080/configs/spring-boot-logger/default/application?ip=192.168.33.1 [Cause: Could not complete get operation [Cause: Read timed out]]
2019-03-23 21:22:34.070  WARN 97534 --- [           main] c.c.f.a.i.RemoteConfigRepository         : Load config failed, will retry in 1 SECONDS. appId: spring-boot-logger, cluster: default, namespaces: application
2019-03-23 21:22:40.077  WARN 97534 --- [           main] c.c.f.a.i.LocalFileConfigRepository      : Sync config from upstream repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository failed, reason: Load Apollo Config failed - appId: spring-boot-logger, cluster: default, namespace: application, url: http://172.18.0.4:8080/configs/spring-boot-logger/default/application?ip=192.168.33.1 [Cause: Could not complete get operation [Cause: Read timed out]]
2019-03-23 21:22:45.082  WARN 97534 --- [           main] c.c.f.a.i.RemoteConfigRepository         : Load config failed, will retry in 1 SECONDS. appId: spring-boot-logger, cluster: default, namespaces: application
2019-03-23 21:22:51.085  WARN 97534 --- [ngPollService-1] c.c.f.a.i.RemoteConfigLongPollService    : Long polling failed, will retry in 1 seconds. appId: spring-boot-logger, cluster: default, namespaces: application, long polling url: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D, reason: java.io.IOException: Server returned HTTP response code: 503 for URL: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D [Cause: Server returned HTTP response code: 503 for URL: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D [Cause: Server returned HTTP response code: 503 for URL: http://172.18.0.4:8080/notifications/v2?cluster=default&appId=spring-boot-logger&ip=192.168.33.1&notifications=%5B%7B%22namespaceName%22%3A%22application%22%2C%22notificationId%22%3A-1%7D%5D]]
2019-03-23 21:22:51.092  WARN 97534 --- [           main] c.c.f.a.i.LocalFileConfigRepository      : Sync config from upstream repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository failed, reason: Load Apollo Config failed - appId: spring-boot-logger, cluster: default, namespace: application, url: http://172.18.0.4:8080/configs/spring-boot-logger/default/application?ip=192.168.33.1 [Cause: Could not complete get operation [Cause: Read timed out]]
2019-03-23 21:22:51.108  INFO 97534 --- [           main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-03-23 21:22:51.176  INFO 97534 --- [           main] c.c.f.a.u.c.s.b.l.LoggerConfiguration    : 监听到level变化 debug logging.level.com.ctrip.framework.apollo.use.cases.spring.boot.logger
2019-03-23 21:22:51.177  INFO 97534 --- [           main] c.c.f.a.u.c.s.b.l.LoggerConfiguration    : logging.level.com.ctrip.framework.apollo.use.cases.spring.boot.logger:debug
2019-03-23 21:22:51.183  INFO 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是info级别日志
2019-03-23 21:22:51.183 ERROR 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是error级别日志
2019-03-23 21:22:51.183  WARN 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是warn级别日志
2019-03-23 21:22:51.183 DEBUG 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是debug级别日志
2019-03-23 21:22:51.360  INFO 97534 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup
2019-03-23 21:22:51.381  INFO 97534 --- [           main] c.c.f.a.u.c.s.boot.logger.Application    : Started Application in 34.439 seconds (JVM running for 38.57)
2019-03-23 21:22:52.186  INFO 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是info级别日志
2019-03-23 21:22:52.186 ERROR 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是error级别日志
2019-03-23 21:22:52.186  WARN 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是warn级别日志
2019-03-23 21:22:52.186 DEBUG 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是debug级别日志
2019-03-23 21:22:53.190  INFO 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是info级别日志
2019-03-23 21:22:53.190 ERROR 97534 --- [pool-3-thread-1] c.c.f.a.u.c.s.boot.logger.PrintLogger    : 我是error级别日志

发现2019-03-23 21:22:17.994 INFO 97534 --- [ main] c.c.f.apollo.core.MetaDomainConsts : Located meta server address http://localhost:8080 for env UNKNOWN from com.ctrip.framework.apollo.internals.DefaultMetaServerProvider

但是通过常规方式部署apollo-quick-start是能测试改case的。

请教一下,这种应该如何调试?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions