tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberto Cosenza" <roberto.cose...@infoflexconnect.se>
Subject Re: separate log4j configurations
Date Tue, 01 Feb 2005 20:26:53 GMT
If you will configure log4j instances which are in the same classloader,
they will conflict.

           Bootstrap
          |
       System
          |
       Common
      /      \
 Catalina   Shared
             /   \
        Webapp1  Webapp2 ...


http://jakarta.apache.org/tomcat/tomcat-5.5-doc/class-loader-howto.html

In other words, your webapp log4j.configuration will override your
tomcat-wide log4j.configuration which may annoy you
/roberto


----- Original Message -----
From: "Tony Tomcat" <tony.tomcat@gmail.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Tuesday, February 01, 2005 8:50 PM
Subject: separate log4j configurations


> Is it safe to have 1 log4j.properties setup for all of tomcat and then
> override it for a webapp that might need slightly different logging?
>
> For example..
>
> I place log4j.jar and the Jakarta commons-logging.jar into the
> $TOMCAT_HOME/common/lib directory and have a log4j properties file in
> $TOMCAT_HOME/common/classes/log4j.properties
>
> This properties file writes to ${catalina.home}/logs/all.out
>
> Then I have a test webapp that I want in its own log4j output file so
> I install a new log4j.properties file in that webapp.
>
> $TOMCAT_HOME/webapps/test/WEB-INF/classes/log4j.properties
>
> This properties file puts the output in ${catalina.home}/logs/test.out
>
> This appears to work but I'm just wondering if this is the correct way
> to go about it.
>
> The reason I want my main logging configuration in common/classes is
> because I want my operations team to control the logging instead of
> the war file.   In the case of my test application I always want it to
> log at the debug level and it is only installed in production briefly
> so having the log4j.properties in the war file is fine and allows me
> to keep it logging at debug even if the other apps are at WARN.
>
> Any issues here?
> Tony
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/related (inline, None, 0 bytes)
View raw message