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 DCDFCDBDF for ; Mon, 10 Dec 2012 01:07:22 +0000 (UTC) Received: (qmail 36382 invoked by uid 500); 10 Dec 2012 01:07:22 -0000 Delivered-To: apmail-logging-log4j-dev-archive@logging.apache.org Received: (qmail 36023 invoked by uid 500); 10 Dec 2012 01:07:22 -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 35705 invoked by uid 99); 10 Dec 2012 01:07:21 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Dec 2012 01:07:21 +0000 Date: Mon, 10 Dec 2012 01:07:21 +0000 (UTC) From: "Gary Gregory (JIRA)" To: log4j-dev@logging.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LOG4J2-133) Allow custom message creation via a 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-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13527673#comment-13527673 ] Gary Gregory commented on LOG4J2-133: ------------------------------------- Fixed and committed. > Allow custom message creation via a message factory > --------------------------------------------------- > > Key: LOG4J2-133 > URL: https://issues.apache.org/jira/browse/LOG4J2-133 > Project: Log4j 2 > Issue Type: Bug > Components: API > Affects Versions: 2.0-beta3 > Environment: Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500) > Maven home: C:\Java\apache-maven-3.0.4\bin\.. > Java version: 1.6.0_35, vendor: Sun Microsystems Inc. > Java home: C:\Program Files\Java\jdk1.6.0_35\jre > Default locale: en_US, platform encoding: Cp1252 > OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows" > Reporter: Gary Gregory > Attachments: log4j2-133.diff, LogManagerAPI.diff > > > My goal here is to be able to say: > Logger log = LogManager.getLogger(Foo.class, new MyMessageFactory()) > Where MyMessageFactory extends a MessageFactory: > and overrides: > public Message newMessage(String message, Object... params) { > return new ParameterizedMessage(message, params); > } > as: > public Message newMessage(String message, Object... params) { > return new StringFormattedMessage(message, params); > } > which would let me use native Java formatting instead of {} formatting /easily/ > I've attach the idea as the beginning of patch, which is missing the LogManager bits. > Maybe we need a sub-interface of Message for param message, which would make me want to rename the class ParameterizedMessage to SimpleParameterizedMessage. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org For additional commands, e-mail: log4j-dev-help@logging.apache.org