You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Stephen Connolly (JIRA)" <ji...@apache.org> on 2014/08/04 01:20:11 UTC

[jira] [Created] (LOG4J2-763) Async loggers convert message parameters toString at log record writing not at log statement execution

Stephen Connolly created LOG4J2-763:
---------------------------------------

             Summary: Async loggers convert message parameters toString at log record writing not at log statement execution
                 Key: LOG4J2-763
                 URL: https://issues.apache.org/jira/browse/LOG4J2-763
             Project: Log4j 2
          Issue Type: Bug
    Affects Versions: 2.0
            Reporter: Stephen Connolly


http://javaadventure.blogspot.com/2014/07/log4j-20-async-loggers-and-immutability.html

TL;DR When using parameterized messages, the toString() method of the log messages is not called when the log message is enqueued, rather after the log message has been dequeued for writing. If any of the message parameters are mutable, they can thus have changed state before the log message is written, thus resulting in the logged message content being incorrect.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

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