logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralph Goers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LOG4J2-1353) Logger 'Object... params' arguments should always be appended even if {} is missing
Date Tue, 05 Apr 2016 15:36:25 GMT

    [ https://issues.apache.org/jira/browse/LOG4J2-1353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15226471#comment-15226471

Ralph Goers commented on LOG4J2-1353:

The current implementation behaves exactly like printf does - the extra arguments are ignored.
I think it would be confusing for most people (and generate bug reports) to have arguments
arbitrarily tacked on at the end.  That said, it should be possible to override ParameterizedMessageFactory
to add this additional capability.  I don't think we should modify ParameterizedMessage to
support this.

> Logger 'Object... params' arguments should always be appended even if {} is missing
> -----------------------------------------------------------------------------------
>                 Key: LOG4J2-1353
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1353
>             Project: Log4j 2
>          Issue Type: New Feature
>          Components: API
>    Affects Versions: 2.5
>            Reporter: Alex Berg
>            Priority: Minor
> The Logger.warn/info/trace etc. has methods that take ... object list. It maps into message
where {} is given. If there are fewer {} than arguments in list, it ignores argument. Who
would ever desire to have an argument ignored? That is to me clearly a bug in the design,
but of cause I may be missing something.
> I suggest to always append the unmatched extra arguments and separate them by a space
or a comma. I'm not sure if the last argument is logged as an exception if it is an exception,
in that case the solution should gracefully handle that.
> A super nice feature would be if it was possible to configure the append of the unmatched
arguments, but I think that is more work than it is worth.
> see http://logging.apache.org/log4j/2.x/log4j-api/apidocs/index.html

This message was sent by Atlassian JIRA

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

View raw message