Hello

We have a setup which compiles WAR applications once and deploys them in 
various environments. Each environment has its own per application Log4j 
configuration (WARN for production, DEBUG for development etc.) which should 
survive application redeployment.

So far the solution is:

webapps/myapp/WEB-INF/web.xml

...
        <context-param>
                <param-name>log4jConfigLocation</param-name>
                
<param-value>file:///opt/tomcat6/conf/myapp/log4j.xml</param-value>
        </context-param>
...

Pretty standard, works.

Question is, how can I make sure the Log4j configuration path is not hard coded 
in the 'web.xml' at development time. Idea was:

webapps/myapp/META-INF/context.xml
...
        <Parameter name="log4jConfigLocation" value="file://TBD" />
...

and change it after the application deployment:

conf/Catalina/localhost/myapp.xml
...
        <Parameter name="log4jConfigLocation" 
value="file:///opt/tomcat6/conf/myapp/log4j.xml" />
...

Tomcat simply ignores both of these context XML files, or at least the 
parameters defined in them. I read through all mailing lists, all 
documentations, switched on debug to the 'finest' level, still no avail. How 
difficult can this be?

Details:

Server version: Apache Tomcat/6.0.35
Server built:   Nov 28 2011 11:20:06
Server number:  6.0.35.0
OS Name:        Linux
OS Version:     2.6.18-348.el5
Architecture:   amd64
JVM Version:    1.6.0_30-b12
JVM Vendor:     Sun Microsystems Inc.


Cheers
B.
                                          

Reply via email to