JSR47 does not provide a better mechanism.  It provides a set of logging
methods that allow you to pass the method name in as a parameter along with
a set that do not.  If the method name is not passed in, the logging
framework will parse the results of new Exception().printStackTrace() and
attempt to deduce the method name.  This is a best-can-do attempt, as the
method name is not required to be in the stack trace output.

Chris

Tivoli Systems
Dept. G49A/Bldg. 501
P.O. Box 12195
Research Triangle Park, NC  27709
(919) 254-9964
Internet:  [EMAIL PROTECTED]


Scruffles - <[EMAIL PROTECTED]> on 02/22/2001 02:43:52 PM

Please respond to "LOG4J Users Mailing List"
      <[EMAIL PROTECTED]>

To:   LOG4J Users Mailing List <[EMAIL PROTECTED]>
cc:
Subject:  Re: method names - how slow?



Wow!  I just got done going through the source code.
I wouldn't have never thought of that.  I guess when
they said it would be slow, I just assumed reflection.
 It never even occured to me that there isn't really a
way to get that kind of information from reflection.

Does anyone know if Sun's JSR47 will allow a better
way of getting this information (maybe from the VM)?

I assume any solution created by Sun would quickly be
integrated into Log4J

--- Luke Blanshard <[EMAIL PROTECTED]> wrote:
> I don't believe reflection has anything to do with
> it.  My understanding is that it
> generates a stack trace, and figures out the method
> name from that.  This means that
> every (executed) log statement causes the creation
> of an exception (which is how stack
> traces are generated).  I imagine that this would
> slow things down somewhat, or maybe a
> lot, but I haven't actually tried it.

__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices!
http://auctions.yahoo.com/

---------------------------------------------------------------------
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]

Reply via email to