Extra logging detail if file is empty
This commit is contained in:
parent
e307fe3137
commit
067c7a295c
|
|
@ -384,20 +384,26 @@ public class ConfigFileApplicationListener implements
|
||||||
String profile) throws IOException {
|
String profile) throws IOException {
|
||||||
Resource resource = this.resourceLoader.getResource(location);
|
Resource resource = this.resourceLoader.getResource(location);
|
||||||
PropertySource<?> propertySource = null;
|
PropertySource<?> propertySource = null;
|
||||||
|
StringBuilder msg = new StringBuilder();
|
||||||
if (resource != null && resource.exists()) {
|
if (resource != null && resource.exists()) {
|
||||||
String name = "applicationConfig: [" + location + "]";
|
String name = "applicationConfig: [" + location + "]";
|
||||||
String group = "applicationConfig: [" + identifier + "]";
|
String group = "applicationConfig: [" + identifier + "]";
|
||||||
propertySource = this.propertiesLoader.load(resource, group, name,
|
propertySource = this.propertiesLoader.load(resource, group, name,
|
||||||
profile);
|
profile);
|
||||||
if (propertySource != null) {
|
if (propertySource != null) {
|
||||||
|
msg.append("Loaded ");
|
||||||
maybeActivateProfiles(propertySource
|
maybeActivateProfiles(propertySource
|
||||||
.getProperty(ACTIVE_PROFILES_PROPERTY));
|
.getProperty(ACTIVE_PROFILES_PROPERTY));
|
||||||
addIncludeProfiles(propertySource
|
addIncludeProfiles(propertySource
|
||||||
.getProperty(INCLUDE_PROFILES_PROPERTY));
|
.getProperty(INCLUDE_PROFILES_PROPERTY));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
msg.append("Skipped (empty) ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg.append("Skipped ");
|
||||||
}
|
}
|
||||||
StringBuilder msg = new StringBuilder();
|
|
||||||
msg.append(propertySource == null ? "Skipped " : "Loaded ");
|
|
||||||
msg.append("config file ");
|
msg.append("config file ");
|
||||||
msg.append("'").append(location).append("'");
|
msg.append("'").append(location).append("'");
|
||||||
if (StringUtils.hasLength(profile)) {
|
if (StringUtils.hasLength(profile)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue