tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stadelmann Josef" <josef.stadelm...@axa-winterthur.ch>
Subject AW: [tomcat 5.5.26] why are not all log4j.properties files parsed
Date Wed, 27 Mar 2013 13:51:51 GMT
Hi Christopher

my comment +++

-----Ursprüngliche Nachricht-----
Von: Christopher Schultz [mailto:chris@christopherschultz.net] 
Gesendet: Dienstag, 26. März 2013 21:19
An: Tomcat Users List
Betreff: Re: [tomcat 5.5.26] why are not all log4j.properties files parsed

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Josef,

On 3/26/13 12:20 PM, Stadelmann Josef wrote:
> we have multiple applications deployed as war files into tomcat 
> webapps.
> 
> each apps has its class directory among a lib directory

Can you explain that in more detail? I do not understand...

+++ your rigth, my real stupid expression, sorry!

> we use log4j-1.2.16 and so each web apps/web-inf/classes has its 
> log4j.properties file
> 
> what we do not understand is the order in which tomcat deployes the 
> several web apps and what we do even less understand is in which order 
> the various log4j.properties are parsed and used. OR are they just 
> parsed and not used, or later used orperhapsused, I tell you "it is a 
> mess!"

I highly suspect that you have log4j.jar in either common/lib or shared/lib. In that case,
your log4j will initialize only once, probably incorrectly.

+++ this is interessting.
IA64-2>dir [.shared]
Directory DKA3:[APACHE.JAKARTA.TOMCAT.shared]
classes.DIR;1       lib.DIR;1
Total of 2 files.
IA64-2>dir [.shared.classes]
%DIRECT-W-NOFILES, no files found
IA64-2>dir [.shared.lib]
%DIRECT-W-NOFILES, no files found
IA64-2>dir
Directory DKA3:[APACHE.JAKARTA.TOMCAT.common]
classes.DIR;1       endorsed.DIR;1      endorsed^.tar.gz;1  i18n.DIR;1 lib.DIR;1
Total of 5 files.
IA64-2>

we use this lib and classes directory in tomcat. it's here in lib where log4j.jar is 
IA64-2>dir [.lib]*log4j*
Directory DKA3:[APACHE.JAKARTA.TOMCAT.common.lib]
log4j-1^.2^.16.jar;1
Total of 1 file.
IA64-2> +++++
	

If you want to use log4j in each web application, you should put a separate log4j.jar file
in each webapp's WEB-INF/lib directory.

+++ we have done that ! there is a minor mismatch as tomcat - the oldest dir - has log4j-1.2.15.jar

while the apps are all at log4j.1.2.16.jar

+++ note the observed behavior in parsing and later in logging is different if we use log4j.configuration=/path/to/tomcats/log4j.properties
as JVM argument from within NetBeans when we start tomcat.


Are you also trying to use log4j for /Tomcat/ logging? If so, you have to do that differently
as well. I'm not sure how well it works (or if at all) with Tomcat 5.5.

+++ yes - we really would like to do that; 
	in example I really need now HostCongig.java's log.debug to print out when tomcat lifecycle
event  does a Reloading Context /axis2 ... causing us tremendous troubles at the moment. Maybe
we'r hacked internally by some security folk.

As you can see in my previous answer, there is a large apache$jakarta_server_output.log and
you can see there that log4j.properties from DKA3:[APACHE.JAKARTA.TOMCAT.common.lib] is parsed.,
well thanks to CHAINSAW, I have found out all the various active loggers of tomcat; I can
say, it works. So it is up to us to define proper appenders for various loggers doing debug
output which will other whise not do any logging. also we need it on a one to one basis because
just turning on debug-logging fro tomcat is a clear no-go in production, but other loggers
like those from HostConfig.java are real helpful in case of troubles.

Thank you Chris
Josef


- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRUgLIAAoJEBzwKT+lPKRYPnQQAMjBdaIFPAbhylE+yPL3aAsQ
RnVWf6sUOQuj+UeJaV+s4jREK9nbwgNaLYskceJZnI+CxsFU7/KhmWdEh4E3PbNA
zh+Iy2Q+3bI2S8SPUBCZEn3CKCMcgUIxcgaPO/IAUeQR0ua6IIF88oBBWmGA2hrq
ibFeACROTHeW+yiixC/nh+5d5RJm3lGwpIoh536D/eugKOY/zEge7XYBoIw3X0YY
j8vz9FDOSmjfAVAr90KskSazIcP1LHOqRhv88RS66gFS1UOWUHuPrFnSqjEy0MeK
OQiyjwl2JhQ0A0wj977kcB7Z/C6O3kCedoHzxJjzwIwcOAuqS+t/i5tE4oAYYPbv
Cnpzoy79E0UszHKoy/ZCC+3XJsB/2Kpg5d5CGjqjICVcicZqCD5Vnu8MUs24+oMp
TQMyXzoB9Wluw5U2v161SFpvoEgByXaG1ibvQ3uk9kRdqMDekN+hhrVpIviNb+/+
AbbrtZWV2ssJIGib7B7UI+v8BxbFkKbXZDJ5AYu7gb+sove5qeCZDN2MlZrbmQfl
+mup3PIX+G8i1Hnl5c92xLVirrEnfumzWjMZ9wbxMeXhk65AkH9zyNiV6EaJ68LE
7OlC7+/BpiPn7sUAvxYwnVk7YOyOx2XvvsBkbzVrjclgp4fW16pH/pQPPAGhJVWY
61drrtfdiLuTJP1w8tiY
=yMAk
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

Mime
View raw message