Consistent logging in ignoreResourceNotFound scenarios
Issue: SPR-15218
(cherry picked from commit 448ea4c)
This commit is contained in:
@@ -419,14 +419,24 @@ class ConfigurationClassParser {
|
||||
addPropertySource(factory.createPropertySource(name, new EncodedResource(resource, encoding)));
|
||||
}
|
||||
catch (IllegalArgumentException ex) {
|
||||
// from resolveRequiredPlaceholders
|
||||
if (!ignoreResourceNotFound) {
|
||||
// Placeholders not resolvable
|
||||
if (ignoreResourceNotFound) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Properties location [" + location + "] not resolvable: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException ex) {
|
||||
// from ResourcePropertySource constructor
|
||||
if (!ignoreResourceNotFound) {
|
||||
// Resource not found when trying to open it
|
||||
if (ignoreResourceNotFound) {
|
||||
if (logger.isInfoEnabled()) {
|
||||
logger.info("Properties location [" + location + "] not resolvable: " + ex.getMessage());
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user