Return-Path: X-Original-To: apmail-logging-log4j-user-archive@www.apache.org Delivered-To: apmail-logging-log4j-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3EA9019A80 for ; Fri, 15 Apr 2016 13:20:13 +0000 (UTC) Received: (qmail 71597 invoked by uid 500); 15 Apr 2016 13:20:13 -0000 Delivered-To: apmail-logging-log4j-user-archive@logging.apache.org Received: (qmail 71545 invoked by uid 500); 15 Apr 2016 13:20:12 -0000 Mailing-List: contact log4j-user-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Users List" Reply-To: "Log4J Users List" Delivered-To: mailing list log4j-user@logging.apache.org Received: (qmail 71534 invoked by uid 99); 15 Apr 2016 13:20:12 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Apr 2016 13:20:12 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 82BE418021A for ; Fri, 15 Apr 2016 13:20:12 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=6.31 tests=[none] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id JFSYEo_Rmvcc for ; Fri, 15 Apr 2016 13:20:09 +0000 (UTC) Received: from smtp618.redcondor.net (smtp618.redcondor.net [208.80.206.18]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id C4E185F5CB for ; Fri, 15 Apr 2016 13:20:08 +0000 (UTC) Received: from mailproxy10.neonova.net ([137.118.22.75]) by smtp618.redcondor.net ({25934d7d-0c4d-4838-a484-2a3cc0768185}) via TCP (outbound) with ESMTP id 20160415131958718_0618 for ; Fri, 15 Apr 2016 13:19:58 +0000 X-RC-FROM: X-RC-RCPT: Received: from [192.168.1.3] (ip72-201-43-179.ph.ph.cox.net [72.201.43.179]) (Authenticated sender: ralph.goers@dslextreme.com) by mailproxy10.neonova.net (Postfix) with ESMTPA id E14C836007C for ; Fri, 15 Apr 2016 09:19:54 -0400 (EDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: Dynamically creating loggers From: Ralph Goers In-Reply-To: Date: Fri, 15 Apr 2016 06:19:56 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <682C83B5-A81F-478C-BC98-AD076F3042F7@dslextreme.com> References: To: Log4J Users List X-Mailer: Apple Mail (2.3112) X-DLP-ENABLED: 137.118.22.64/27 X-MAG-OUTBOUND: greymail.redcondor.net@137.118.22.64/27 The logging implementation stores the logger in a map. However, when = you call getLogger ClassLoaderContextSelector will have to locate the = ClassLoader for the class loading the Logger. This can be fairly = expensive. If you are using a different ContextSelector it might work = better. Or you can create a Map of the Loggers yourself. Ralph > On Apr 15, 2016, at 2:02 AM, Jochen Wiedmann = wrote: >=20 > Hi, >=20 > I've got an application, where I would like to obtain loggers on the > fly, because the logger name isn't known in advance. (Think of it as a > logging server, which will be used by remote clients.) >=20 > Now, creating a Logger might be an expensive operation. Thus, my = question: >=20 > - Would you recommend to always invoke LogManager.getLogger(String) > and use the result? > - Or would it be better to maintain a Map with the > logger name as key? >=20 > Thanks, >=20 > Jochen >=20 > --=20 > The next time you hear: "Don't reinvent the wheel!" >=20 > = http://www.keystonedevelopment.co.uk/wp-content/uploads/2014/10/evolution-= of-the-wheel-300x85.jpg >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org > For additional commands, e-mail: log4j-user-help@logging.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-user-help@logging.apache.org