You can subclass PropertyPlaceHolderConfigurer
, something like this:
public class LoggingPlaceholderConfigurer extends PropertyPlaceholderConfigurer {
@Override
public void setLocations(final Resource[] locations) {
if(logger.isDebugEnabled())
for (final Resource resource : locations) {
logger.debug("Using resource: " + resource);
}
super.setLocations(locations);
}
@Override
protected Properties mergeProperties() throws IOException {
final Properties mergedProperties = super.mergeProperties();
if(logger.isDebugEnabled())
for (final Entry<String, Object> propertyEntry :
new TreeMap<String, Object>((Map) mergedProperties).entrySet()) {
logger.debug(
"Key:" + propertyEntry.getKey()
+ ", value:" + propertyEntry.getValue());
}
return mergedProperties;
}
}
Now wire your custom class manually (namespace won't work):
<bean class="path.to.LoggingPlaceholderConfigurer">
<property name="locations" value="classpath*:*.properties" />
</bean>
And set your logging configuration so that log level debug is active for LoggingPlaceholderConfigurer
(This is meant to be a temporary replacement for <context:property-placeholder>
for debugging purposes only)