logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Gregory (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-133) Allow custom message creation via a message factory
Date Mon, 10 Dec 2012 01:07:21 GMT

    [ 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


Mime
View raw message