[
https://issues.apache.org/jira/browse/LOG4J2-898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14338231#comment-14338231
]
Remko Popma commented on LOG4J2-898:
------------------------------------
Steven, Jin,
I don't have time to work on this myself but I will try to find time to review
a patch.
If you want to work on a patch, please take into account my previous comment.
Specifically, if you use ParameterizedMessage, that is, your code looks like
for example {{logger.debug("var x value is {}, var y value is {}", x, y);}}
then you will need to do more than just introduce a system property to avoid
the call to message.getFormattedMessage().
For usage like {{logger.debug(object);}} or {{logger.debug("some fixed
string");}}, reverting to pre- LOG4J2-763 behaviour based on a system property
would work.
> Format messages asynchronously
> ------------------------------
>
> Key: LOG4J2-898
> URL: https://issues.apache.org/jira/browse/LOG4J2-898
> Project: Log4j 2
> Issue Type: Improvement
> Affects Versions: 2.0.2, 2.1
> Reporter: Steven Grossman
> Assignee: Remko Popma
> Fix For: 2.2
>
>
> Formatting a message can be an expensive operation (e.g. String.format) and
> it is undesirable for it to be done in the calling thread when using an async
> logger or appender.
> LOG4J2-763 moved this work to the calling thread. Would you consider
> bringing back the previous behavior via a config/system property?
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]