-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
解决日志系统未初始化完成时,apollo 的加载日志没法输出问题 #3677
Conversation
# Conflicts: # README.md
…stem initialization cannot be output apolloconfig#3671
Codecov Report
@@ Coverage Diff @@
## master #3677 +/- ##
============================================
- Coverage 50.99% 50.82% -0.18%
- Complexity 2333 2373 +40
============================================
Files 449 452 +3
Lines 14033 14279 +246
Branches 1426 1431 +5
============================================
+ Hits 7156 7257 +101
- Misses 6385 6517 +132
- Partials 492 505 +13
Continue to review full report at Codecov.
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultConfig.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/ctrip/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java
Outdated
Show resolved
Hide resolved
Here is my 2 cents, what do you think?
|
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultConfig.java
Outdated
Show resolved
Hide resolved
...rc/main/java/com/ctrip/framework/apollo/spring/boot/ApolloApplicationContextInitializer.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLog.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLog.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
@klboke please fix the failed tests |
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
apollo-core/src/test/java/com/ctrip/framework/apollo/core/utils/DeferredLoggerTest.java
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogger.java
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultConfig.java
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogger.java
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
…dd copyright information to the file header
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogger.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogger.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Show resolved
Hide resolved
apollo-core/src/main/java/com/ctrip/framework/apollo/core/utils/DeferredLogCache.java
Outdated
Show resolved
Hide resolved
apollo-client/src/main/java/com/ctrip/framework/apollo/internals/DefaultConfig.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What's the purpose of this PR
解决 spring boot 方式集成时,配置
apollo.bootstrap.eagerLoad.enabled
情况下,apollo 的加载日志没法输出问题。封装一个基于 guava-cache 的日志输出内容存储容器
DeferredLogUtil
,将 apollo 初始化时的日志信息,添加到延迟输出的日志容器。在日志系统加载完成也就是 EnvironmentPostProcessor 事件立刻回放,最终实现的效果和不开启apollo.bootstrap.eagerLoad.enabled
是一样的,设计过程参考了 spring-boot#DeferredLog