The actual code that grabs the runtime information is located in the 
org.apache.log4j.spi.LocationInfo 
class.  To enable the logging of this information, you simply have to use 
a PatternLayout (or something
similar) in your configuration with the method/classname flags turned on. 
The JavaDoc for this class 
has more details.

-Mike Wolf





James Vera <[EMAIL PROTECTED]>
07/26/01 05:11 PM
Please respond to "LOG4J Users Mailing List"

 
        To:     "'LOG4J Users Mailing List'" <[EMAIL PROTECTED]>
        cc: 
        Subject:        RE: Designing Logging class



>From: Mike.Wolf 
... 
>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. 
Apologies if this is obvious (i'm just exploring log4j), but I didn't 
see where (in docs or code) log4j does this runtime 
determination.  In fact this seemed to me to be one of the significant 
differences between JSR47 and log4j.  However, since this wasn't noted as 
a 
difference in the "JSR47 vs. log4j" article I have doubt about my 
observation. 
Are you log4j does this / could you point me at some doc or code? 
Regards, 
James Vera 



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

Reply via email to