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 Salou Loic <lo...@gva.eri.ch> on 2003/04/15 12:59:39 UTC

RE : AW: Performance and Logger.getLogger()

Je sais j'étais abonné aussi. Le pb des perfs est à prendre en compte mais
il ne faut pas se priver des fonctionnalités offertes par Log4j pour éviter
un accès dans une Hashtable...

J'encapsule pour ma part les instances de Log4jLogFile créées dans une Map,
c'est une interface supplémentaire nécessaire pour assurer une interface
commune entre nos 2 APIs de log.

Mr Loïc Salou,
eRI Bancaire SA, 4-6 avenue industrielle, 1227 Carouge,
GVA NT-Architecture
 
' +41 22 309 10 46 (int 9246)
@  losalou@gva.eri.ch


-----Message d'origine-----
De : Ceki Gülcü [mailto:ceki@qos.ch] 
Envoyé : mercredi, 2. avril 2003 16:51
À : Log4J Users List
Objet : Re: AW: Performance and Logger.getLogger()


At 04:41 PM 4/2/2003 +0200, you wrote:
>Hey!
>
>Erik:
>
>The FAQ:
>http://jakarta.apache.org/log4j/docs/FAQ.html
>
>
>You are on the right track.
>
>The question is:
>
>{
>         Logger logger = Logger.getLogger("foo.bar");
>
>         logger.warn("");
>         logger.error("");
>
>}(Good)

yes. good.

>vs.
>{
>         Logger.getLogger("foo.bar").warn("");
>         Logger.getLogger("foo.bar").warn("");
>         Logger.getLogger("foo.bar").warn("");
>}(Bad)

yes, bad.

Logger.getLogger("something") will essentially perform a look up on a 
hashtable. I don't think you could improve on this by keeping your own 
hashtable. There are ways where you could potentially improve on the lookupp
 erformance but this would require a really disproportionate amount of 
effort on your part.


--
Ceki 


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



**********************************************************************
 This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************