Mikael Ståldal created LOG4J2-1452:
--------------------------------------

             Summary: Reusable messages break flow tracing logic
                 Key: LOG4J2-1452
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1452
             Project: Log4j 2
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.6.1, 2.6
            Reporter: Mikael Ståldal


Flow tracing assumes that you can save an instance of {{EntryMessage}} across a 
method, but if you log something else within that method and reusable messages 
are in effect (as they are by default since 2.6), this does not always work 
properly.

This code illustrate the issue:
{code}
        EntryMessage entryMessage = 
logger.traceEntry(logger.getMessageFactory().newMessage("the entry"));
        logger.info("something else");
        logger.traceExit(entryMessage);
{code}

It works as expected if you remove the middle {{logger.info()}}, but with it 
the exit message gets messed up.



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