Announcement Announcement Module
Collapse
No announcement yet.
Logs are misleading if using system property placeholders with Log4jWebConfigurer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Logs are misleading if using system property placeholders with Log4jWebConfigurer

    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:

    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>
    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.

    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?

  • #2
    IMHO, well deserves JIRA.

    Regards,
    Oleksandr

    Comment

    Working...
    X