You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Ceki Gülcü <cg...@qos.ch> on 2001/02/22 23:17:38 UTC

ConsoleHandler? - was method names - how slow?

Hi Chris,

Good to have you around! One unrelated question. JSR47 has a ConsoleHandler that logs to System.err. JLog has a ConsoleHandler that logs to System.out and ErrorHandler that logs to System.out. Do you know why Graham chose to have ConsoleHandler log only to System.err? Your model seems to make more sense... Just curious. Ceki

At 14:55 22.02.2001 -0500, Chris_Barlock@tivoli.com wrote:
>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:  barlock@tivoli.com
>
>
>Scruffles - <ba...@yahoo.com> on 02/22/2001 02:43:52 PM
>
>Please respond to "LOG4J Users Mailing List"
>      <lo...@jakarta.apache.org>
>
>To:   LOG4J Users Mailing List <lo...@jakarta.apache.org>
>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 <lu...@quiq.com> 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: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org

----
Ceki Gülcü          Web:   http://qos.ch      
av. de Rumine 5     email: cgu@qos.ch (preferred)
CH-1005 Lausanne           ceki_gulcu@yahoo.com
Switzerland         Tel: ++41 21 351 23 15