Hi,
I just came across a litte inconsistency in Spring's logging and I wonder whether it's wort raising an issue in Jira:
We're using system property placeholders in the resource string used to configure Log4J in a web app, like this:
With non-URL resources, the system property placeholders are resolved by Log4jWebConfigurer and the result logged, e.g. "Initializing Log4J from [log4j-production.properties]". All fine and dandy.Code:<listener> <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class> </listener> <context-param> <param-name>log4jConfigLocation</param-name> <param-value>log4j-${com.example.env}.properties</param-value> </context-param>
But with URL resources (e.g. "classpath:log4j-${com.example.env}.properties"), Log4jWebConfigurer delegates to Log4jConfigurer without resolving the system property placeholders first. The log message then says "Initializing Log4J from [classpath:log4j-${com.example.env}.properties]", which sounds wrong. Log4jConfigurer does not log the resolved URL either.
So by just looking at the logs, it seems like the system property placeholders were not resolved, even though everything works as expected.
Not a big deal, but not too nice either. Any opinions?


Reply With Quote