Announcement Announcement Module
Collapse
No announcement yet.
configure log4j in unexpanded war Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • configure log4j in unexpanded war

    Hi,

    Can anyone tell me how if they have a good way of configuring log4j from the web.xml where the war does not have to be expanded?

    The Spring helper Log4jWebConfigurer works only with expanded wars. I am using Weblogic 9.2 and deploying to a cluster. I can't use absolute paths as I have no idea where Weblogic expands the war to

    Any help will be very much appreciated.

    Regards,

    Abdul

  • #2
    Have you tried using the 'classpath:' notation in the location parameter of
    Code:
    Log4jConfigurer.initLogging()
    If the location is relative to your project, classpath: will start at the project root (e.g. if your log4j.props file is at /WEB-INF/log4j.properties, it should work to specify the path as classpath:/WEB-INF/log4j.properties).

    This can be configured in web.xml:

    Code:
    <context-param>
      <param-name>log4jConfigLocation</param-name>
      <param-value>classpath:/WEB-INF/log4j.properties</param-value>
    </context-param>
    
    ...
    
    <listener>
      <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>
    Last edited by jstehler; Oct 5th, 2007, 02:54 PM. Reason: additional info

    Comment

    Working...
    X