That's why you need to provide the fully-qualified classname. If you
use the wrapper I showed, you will not have this problem. That is, the
class and method name of the wrapper caller, not the wrapper itself,
will be logged. The code which determines the logging method looks one
past the fully-qualified classname in the callstack. Check it out, I
thought it was rather ingenious myself.

-- Don

--- [EMAIL PROTECTED] wrote:
> One piece of warning about wrapping the log4j api's.  The code which 
> determines the logging method is dependent on that method being the
> last
> method in the call stack prior to the Category logging method. 
> Consequently,
> if you wrap the log4j calls, then every logging message will appear
> to be 
> coming from the wrapper methods rather than the method requesting the
> log 
> message.
> This is only an issue if you want to have access to the extended
> runtime 
> information
> (class, method, line number, etc) in your logs.
> 
> -Mike Wolf
> 
> 
> 
> 
> 
> "Craig Newlander" <[EMAIL PROTECTED]>
> 08/23/01 11:27 AM
> Please respond to "LOG4J Users Mailing List"
> 
>  
>         To:     "LOG4J Users Mailing List"
> <[EMAIL PROTECTED]>
>         cc: 
>         Subject:        log4j wrapper
> 
> 
> Hello,
> 
>    I'd like to absract log4j from my appilication so I don't have to
> do a
> import org.apache.log4j.* throughout my source files and be dependant
> on 
> the
> Category class.   What is a good method to employ here?
> 
> Craig
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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

Reply via email to