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 Wulf Wechsung <ww...@contexo.de> on 2003/04/02 16:10:59 UTC

Performance and Logger.getLogger()

Hey!

I read in the faq that calling Logger.getLogger() will kill app performance.
I am currently writing a wrapper for a beast called the SAP/webMethod
business connector which is an app-server providing a 'unique' flow language
to programm services. It would be to quite an effort to ask the developers
of those services to keep references to their logger and pass it for each
log statement, so I would did an implementation that determines which logger
to use by itself. Unfortunatly it has to call Logger.getLogger() for each
log-call. 
The question is: would application performance be better if I kept the
Logger references in a hashtable and retrieved them from there by name? 
This might seem like an unnecessary question but I just don't know how much
over-heap there is involved when calling Logger.getLogger().

Thanks in advance,
Wulf

PS:"I made a serious effort to see if this has been asked before via the
mail archives, so please excuse me if it, in fact, has been"

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Performance and Logger.getLogger()

Posted by Erik Price <ep...@ptc.com>.

Wulf Wechsung wrote:

> I read in the faq that calling Logger.getLogger() will kill app performance.
> I am currently writing a wrapper for a beast called the SAP/webMethod
> business connector which is an app-server providing a 'unique' flow language
> to programm services. It would be to quite an effort to ask the developers
> of those services to keep references to their logger and pass it for each
> log statement, so I would did an implementation that determines which logger
> to use by itself. Unfortunatly it has to call Logger.getLogger() for each
> log-call.

Hi Wulf,

I did not see this FAQ.  Can you post the URL so that I can read it too? 
  Currently I have a call to Logger.getLogger() in every class and the 
returned Logger is stored in a static field.  This is not the common way 
to acquire a logger?

Thank you,


Erik


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org