I simply pass in the class of the object/static calling the abstract
logger - e.g. LogFactory.getInstance().error(this.getClass(), "error!");

sam
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: "LOG4J Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, July 17, 2001 5:56 PM
Subject: RE: Designing Logging class


> For the project I'm working on, we've done something similar.  The one
> problem
> that you run into when you do this (or use any sort of abstraction for
> logging) is that
> log4j will no longer be able to accurately determine runtime information
> such as
> the calling method/class/line number.  The reason for this is that this
> information is
> determined by generating a Throwable and then locating the relevant
> information in
> the call stack.  By using an abstraction layer, you throw off the
> calculation, so it ends up
> always saying that the calling method is your abstracted log method.
>
> If anyone has found a way to get around this, feel free to comment.
>
> -Mike



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to