Issue-753 Adds debug logging of property source information (#760)

Co-authored-by: Paul Jeffrey <paul.jeffrey@L3Harris.com>
This commit is contained in:
Paul Jeffrey
2021-04-07 13:52:57 -06:00
committed by GitHub
parent afc528335c
commit 79bcd2eaa5
2 changed files with 24 additions and 0 deletions

View File

@@ -102,6 +102,15 @@ public abstract class ConfigurationChangeDetector {
this.log.warn(
"The current number of ConfigMap PropertySources does not match "
+ "the ones loaded from the Kubernetes - No reload will take place");
if (log.isDebugEnabled()) {
this.log.debug(String.format("source 1: %d", l1.size()));
l1.forEach(item -> log.debug(item));
this.log.debug(String.format("source 2: %d", l2.size()));
l2.forEach(item -> log.debug(item));
}
return false;
}
@@ -142,6 +151,11 @@ public abstract class ConfigurationChangeDetector {
LinkedList<PropertySource<?>> sources = toLinkedList(
this.environment.getPropertySources());
this.log.debug("findPropertySources");
this.log.debug(String.format("environment: %s", this.environment));
this.log.debug(String.format("environment sources: %s", sources));
while (!sources.isEmpty()) {
PropertySource<?> source = sources.pop();
if (source instanceof CompositePropertySource) {
@@ -197,6 +211,10 @@ public abstract class ConfigurationChangeDetector {
+ propertySource.getClass());
}
this.log.debug("locateMapPropertySources");
this.log.debug(String.format("environment: %s", environment));
this.log.debug(String.format("sources: %s", result));
return result;
}

View File

@@ -141,6 +141,9 @@ public class EventBasedConfigurationChangeDetector extends ConfigurationChangeDe
}
private void onEvent(ConfigMap configMap) {
this.log.debug(String.format("onEvent configMap: %s", configMap.toString()));
boolean changed = changed(
locateMapPropertySources(this.configMapPropertySourceLocator,
this.environment),
@@ -152,6 +155,9 @@ public class EventBasedConfigurationChangeDetector extends ConfigurationChangeDe
}
private void onEvent(Secret secret) {
this.log.debug(String.format("onEvent configMap: %s", secret.toString()));
boolean changed = changed(
locateMapPropertySources(this.secretsPropertySourceLocator,
this.environment),