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] [Updated] (LOG4J2-1055) Logger method overloads for multiple message formatting params
Date Sat, 27 Jun 2015 08:27:04 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-1055?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Gary Gregory updated LOG4J2-1055:
    Priority: Major  (was: Critical)

Not critical.

> Logger method overloads for multiple message formatting params
> --------------------------------------------------------------
>                 Key: LOG4J2-1055
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1055
>             Project: Log4j 2
>          Issue Type: Improvement
>          Components: API
>    Affects Versions: 2.3
>            Reporter: Tomasz Kowalczewski
>              Labels: performance
> When logging message with parameters Logger interface provide methods of the form {debug/info/error}(Marker
marker, String message, Object... params);
> This means there will be an array of params created for each call. There should be overrides
that accept one param, two params etc.
> SLF4J has such overrides and require explicit array creation if someone provides too
many params (there is no varargs version). If people use LOG4J2 under the covers they will
be surprised that arrays are created for every call. 
> What is worse, people think that call of the form
> LOGGER.debug("Message: {}", foobar);
> when using SLF4J does not need to be wrapped in if(LEGGER.isDebugEnabled()) check as
the API is specifically designed that there should be no object allocation happening if the
level is disabled. LOG4J2 breaks that promise.
> This array creation is visible in our applications - it is not optimised away by escape

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