Return-Path: X-Original-To: apmail-logging-log4j-dev-archive@www.apache.org Delivered-To: apmail-logging-log4j-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2FB3F18A5F for ; Mon, 2 Nov 2015 15:46:31 +0000 (UTC) Received: (qmail 45876 invoked by uid 500); 2 Nov 2015 15:46:28 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 45739 invoked by uid 500); 2 Nov 2015 15:46:28 -0000 Mailing-List: contact log4j-dev-help@logging.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Log4J Developers List" Reply-To: "Log4J Developers List" Delivered-To: mailing list log4j-dev@logging.apache.org Received: (qmail 45498 invoked by uid 99); 2 Nov 2015 15:46:27 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2015 15:46:27 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id C696F2C1F6E for ; Mon, 2 Nov 2015 15:46:27 +0000 (UTC) Date: Mon, 2 Nov 2015 15:46:27 +0000 (UTC) From: "Gary Gregory (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-1180) Logger cache does not account for message factory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LOG4J2-1180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14985411#comment-14985411 ] Gary Gregory commented on LOG4J2-1180: -------------------------------------- There were some inefficiencies or even 'bugs' if you want to call them that, which I addressed. Can you please review the changes? Thank you, Gary > Logger cache does not account for message factory > ------------------------------------------------- > > Key: LOG4J2-1180 > URL: https://issues.apache.org/jira/browse/LOG4J2-1180 > Project: Log4j 2 > Issue Type: Bug > Components: API > Affects Versions: 2.4.1 > Reporter: Gary Gregory > Assignee: Gary Gregory > Fix For: 2.5 > > Attachments: LOG4J2-1180.diff > > > The Logger cache does not account for a logger's message factory. > If you call {{LogManager.getLogger(Class|Object|String, MessageFactory)}} and then call a getLogger() API again with the same {{Class|Object|String}} a different message factory, you get the Logger that was first created which means you will not get the proper formatted messages. > For example: > {code:java} > Logger loggerA1 = LogManager.getLogger("A", messageFactory1); > Logger loggerA2 = LogManager.getLogger("A", messageFactory2); > {code} > loggerA1 is the same as loggerA2. > This is a problem if two unrelated code bases (jars) both the same Logger names|objects|classes. -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org