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

Remko Popma commented on LOG4J2-898:
------------------------------------

Hi Gary,

Thanks for reminding me. I was planning to introduce a system property to 
control whether async loggers/appenders should call 
{{message.getFormattedMessage()}} before passing the log event to the 
background thread (AsyncLogger.java line 249, AsyncLoggerConfigHelper.java line 
340, AsyncAppender.java line 143).

Unfortunately this is currently implemented a bit inconsistently in the various 
Message implementations. For example, {{ParameterizedMessage}} currently does 
the formatting work in the constructor, so avoiding the call to 
{{message.getFormattedMessage()}} will not make a difference for 
ParameterizedMessage. Not sure on whether to include modifying 
ParameterizedMessage in the scope of this ticket.

As for timeline, I am currently in the final weeks of my online courses. I hope 
to be able to start working on Log4j again around the year-end holidays. If you 
want to take this ticket, I am fine with that.

> 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]

Reply via email to