Results 1 to 2 of 2

Thread: Logs are misleading if using system property placeholders with Log4jWebConfigurer

  1. #1

    Default 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. #2
    Join Date
    Aug 2006
    Location
    Now Germany, previously Ukraine
    Posts
    1,546

    Default

    IMHO, well deserves JIRA.

    Regards,
    Oleksandr

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •