logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Devereaux" <Mike.Devere...@wnco.com>
Subject Re: repeated messages with tomcat
Date Wed, 16 Jan 2002 20:47:24 GMT

I've found that in environments (ie J2EE Websphere) that multiple class loaders are being
used.
In each case, you get a static initialization of a Category that causes the same Appenders
to be reregistered.
So, for example, your ConsoleAppender is probably getting registered twice, and the output
is therefore being sent through it twice.

I've experienced this; it may be what's happening to you.  There is a Q&A in the Log4J
FAQ (on the web site) dealing with output appearing multiple times - i don't remember what
the solution was but the FAQ Q&A I remember keyed me to the correct solution.

Hope this helps,
~mike

>>> danlip@nuserve.com 01/16/02 01:29PM >>>
I am using log4j 1.1.3 with tomcat 3.2.4.  All
my debug messages are printing out multiple times, and
I cannot figure out why.  Here is my log4j.properties file:

log4j.debug=true
log4j.rootCategory=debug,stdout
log4j.appender.stdout = org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout = org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern =%5p [%c{1}:%L] %m%n

Here is the info it prints out when it parses it:

log4j: Parsing for [root] with value=[debug,stdout].
log4j: Priority token is [debug].
log4j: Category root set to DEBUG
log4j: Parsing appender named "stdout".
log4j: Parsing layout options for "stdout".
log4j: Setting property [conversionPattern] to [%5p [%c{1}:%L] %m%n].
log4j: End of parsing for "stdout".
log4j: Parsed "stdout" options.
log4j: Finished configuring.

And here is a sample:

DEBUG [FooBar:518]  sample debug message
51168 [Thread-10] DEBUG nuserve.tier1.request.FooBar  -  sample debug
message
51168 [Thread-10] DEBUG nuserve.tier1.request.FooBar  -  sample debug
message

can anyone help me fix this?
Thanks,
Dan



--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>



--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message