This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.2 by this push:
new 3fa518505f Add log for remote configuration. (#12294)
3fa518505f is described below
commit 3fa518505fc54be59e4306300891e54db4610240
Author: Ken Liu <[email protected]>
AuthorDate: Mon Jun 12 20:30:42 2023 +0800
Add log for remote configuration. (#12294)
* add log for remote configuration.
* Give dynamic routing rule notification 'info' log level.
* remove unused imports
* revert warn log change
* fix import
---------
Co-authored-by: Albumen Kevin <[email protected]>
---
.../rpc/cluster/router/condition/config/ListenableStateRouter.java | 4 ++--
.../org/apache/dubbo/rpc/cluster/router/tag/TagStateRouter.java | 4 ++--
.../org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java | 6 ++++++
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
index 40758c4f3e..0efbe0be39 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/condition/config/ListenableStateRouter.java
@@ -64,8 +64,8 @@ public abstract class ListenableStateRouter<T> extends
AbstractStateRouter<T> im
@Override
public synchronized void process(ConfigChangedEvent event) {
- if (logger.isDebugEnabled()) {
- logger.debug("Notification of condition rule, change type is: " +
event.getChangeType() +
+ if (logger.isInfoEnabled()) {
+ logger.info("Notification of condition rule, change type is: " +
event.getChangeType() +
", raw rule is:\n " + event.getContent());
}
diff --git
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagStateRouter.java
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagStateRouter.java
index 5b8f9519ea..c3470776b2 100644
---
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagStateRouter.java
+++
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/router/tag/TagStateRouter.java
@@ -63,8 +63,8 @@ public class TagStateRouter<T> extends AbstractStateRouter<T>
implements Configu
@Override
public synchronized void process(ConfigChangedEvent event) {
- if (logger.isDebugEnabled()) {
- logger.debug("Notification of tag rule, change type is: " +
event.getChangeType() + ", raw rule is:\n " +
+ if (logger.isInfoEnabled()) {
+ logger.info("Notification of tag rule, change type is: " +
event.getChangeType() + ", raw rule is:\n " +
event.getContent());
}
diff --git
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
index ca597f2ee9..bf8d285681 100644
---
a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
+++
b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/deploy/DefaultApplicationDeployer.java
@@ -837,12 +837,18 @@ public class DefaultApplicationDeployer extends
AbstractDeployer<ApplicationMode
if (StringUtils.isNotEmpty(configCenter.getConfigFile())) {
String configContent =
dynamicConfiguration.getProperties(configCenter.getConfigFile(),
configCenter.getGroup());
+ if (StringUtils.isNotEmpty(configContent)) {
+ logger.info(String.format("Got global remote configuration
from config center with key-%s and group-%s: \n %s",
configCenter.getConfigFile(), configCenter.getGroup(), configContent));
+ }
String appGroup = getApplication().getName();
String appConfigContent = null;
String appConfigFile = null;
if (isNotEmpty(appGroup)) {
appConfigFile =
isNotEmpty(configCenter.getAppConfigFile()) ? configCenter.getAppConfigFile() :
configCenter.getConfigFile();
appConfigContent =
dynamicConfiguration.getProperties(appConfigFile, appGroup);
+ if (StringUtils.isNotEmpty(appConfigContent)) {
+ logger.info(String.format("Got application specific
remote configuration from config center with key %s and group %s: \n %s",
appConfigFile, appGroup, appConfigContent));
+ }
}
try {
Map<String, String> configMap =
parseProperties(configContent);