logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Blok, Eelke" <eelke.b...@numico.com>
Subject RE: Jar logging
Date Wed, 08 Aug 2007 14:15:19 GMT

Could it be that you use a common member variable (e.g. "logger") between the original class
and your derived class? Depending on when this member variable gets set with an instance of
an actual logger object, this logger may have either the parent class's or the derived class's
name (remember, there is no link between any class and any logger, except for their name;
it's programmer who *chooses* (by convention) to name their logger after the class it is used

If you indeed are using a single "logger" member variable, when any code in either class uses
any method on that one logger member variable, they will both log to the same physical logger
object, regardless of the location in the code from where the log method is called (the name
of that logger object depends on the place where the member variable was last tied to a logger
object). To get the behaviour you seem to require, you need to make absolutely sure that the
code for your derived class uses a unique logger that is not in any way shared with the original
class's code.

Good luck,

-----Original Message-----
From: Juan Carlos García-Reiriz Pampín [mailto:carlos.pampin@gmail.com] 
Sent: woensdag 8 augustus 2007 10:27
To: log4j-user@logging.apache.org
Subject: Jar logging


I'm new in log4j, anybody could tell me how config the log4j.properties to log only my jar
I set
but if have this situation:


my.package.ClassB extends ClassA

then ClassA traces are shown

please, help!!

sorry for my bad english

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

View raw message