apolloconfig / apollo

Apollo is a reliable configuration management system suitable for microservice configuration management scenarios.
https://www.apolloconfig.com
Apache License 2.0
29.13k stars 10.2k forks source link

Apollo Java客户端初始化过程日志打印问题 #3640

Closed laywin closed 2 years ago

laywin commented 3 years ago

Describe the bug 当apollo.bootstrap.eagerLoad.enabled=true时,Apollo初始化过程中的日志均无法输出

To Reproduce Steps to reproduce the behavior: 当apollo.bootstrap.eagerLoad.enabled=true时,spring boot日志系统并未初始化好,这个过程中产生的日志均无法输出

Expected behavior 建议可以根据类似spring boot中DeferredLog的处理方式来进行这个阶段的日志打印

nobodyiam commented 3 years ago

目前确实存在这个问题,粗看了下 DeferredLog 的实现,大致是先把日志存在内存中,然后在接收到 ApplicationPreparedEvent 后再把日志输出,应该是可以借鉴实现一下的

klboke commented 3 years ago

参考 DeferredLog 的方式,缓存了下日志系统未初始化前的日志,详情见 pr:https://github.com/ctripcorp/apollo/pull/3677

nobodyiam commented 2 years ago

implemented by #3677