logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bruno Melloni" <Bruno.Mell...@akuratus.com>
Subject Re: R: Multiple log4j.properties
Date Mon, 29 Aug 2005 12:17:20 GMT
As I mentioned in my previous reply... it depends on the version of Tomcat.  If you are having
this problem, solutions exist.  Here are a couple of ideas to explore, one of them might help
you:

a) You might want to name the properties differently for each application (for example: app1Log4j.properties).
 We started doing it a long time ago and I cannot remember the reason, but there was one.

b) You can also put "silencing rules" in your properties files (i.e.: severity = ERROR, or
FATAL)... so that even if you have "leaking" between the server and the apps each log file
will exclude the other's noise.

bruno

Bruno Melloni
Director of Software Architecture
Akuratus Corporation
1333 N. Stemmons Fwy, Suite 110
Dallas, Texas 75207
Phone: 469.227.0920
Fax: 469.227.0967
bruno.melloni@akuratus.com
www.akuratus.com

>>> f.squittieri@comune.prato.it 08/29 1:29 AM >>>
So if i have a log4j.jar in any webapp i can say that their log4j.properties are completely
independent?

And i shouldn't mind if someone puts a log4j.rootLogger=DEBUG,stdout somewhere in any log4j.properties?

I don't know but it seems to me the opposite, i mean few months ago we deployed a web app
which was bought from another software house; they used log4j configuring it as above (root
logger at DEBUG level...), the result was an impressing amount of logging statements...and
they did have a log4j.jar under their lib...

FS

-----Messaggio originale-----
Da: Jacob Kjome [mailto:hoju@visi.com] 
Inviato: venerdì 26 agosto 2005 16.29
A: Log4J Users List
Oggetto: Re: Multiple log4j.properties

Quoting Fabrizio Squittieri <f.squittieri@comune.prato.it>:

> Hi,
> i've got a simple question.
> We have a Tomcat 5.0.5 on A linux server which runs a number of web 
> apps.
>
> Now we wanted to configure log4j in a single file and we did it by 
> adding a
>       -Dlog4j.configuration=file:/usr1/config_tmp/log/log4j.properties 
> \ row to catalina.sh .
>
> The question is: What does it happen if a web-app puts a 
> log4j.properties (e.g.log4j.rootLogger=DEBUG,stdout or some other bad 
> configs) in its WEB-INF/classes?
>
> Does it overwrite the global config?
>

No, it won't overwrite the global config as long as a copy of log4j.jar is included in the
webapp.  It will use its own configuration and be completely separated from the global logger
repository.  This is because of Tomcat's default parent-last classloading behavior (recommended
by the servlet spec). 
If you had parent-first classloading behavior, which is usually the default in most larger
application servers, then you would have a problem.


Jake

> Thanks
>
> Fabrizio Squittieri - Programmatore
>
> Sistema informativo - Comune di Prato
> Via Cairoli 16 - Prato
> 0574615275
>
> f.squittieri@comune.prato.it 
> fabrizio@squittieri.it 
>
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org 
For additional commands, e-mail: log4j-user-help@logging.apache.org 


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org 
For additional commands, e-mail: log4j-user-help@logging.apache.org 



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message