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.

Luke

Scruffles - wrote:

> Of course I understand that reflection is slow.  My
> boss is insistent that we should be able to log the
> method name, however, and I'm not sure what to tell
> him.  In our old logging system, the programmer passed
> the method name as one of the parameters.  This is a
> bit of a pain (not to mention it was prone to error).
> No one here wants to use anything with reflection
> (personally, I don't think we even need the method
> names).
>
> I would like to just use Log4J's ability to show
> method names, should the case arise that we really
> need them - they could always be turned off.
>
> What is the general opinion?  Should reflection be
> avoided at all costs, or should we just be careful of
> what we log?
>
> __________________________________________________
> 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