Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1452

Reusable messages break flow tracing logic

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.6, 2.6.1
    • Fix Version/s: 2.6.2
    • Component/s: Core
    • Labels:
      None

      Description

      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:

              EntryMessage entryMessage = logger.traceEntry(logger.getMessageFactory().newMessage("the entry"));
              logger.info("something else");
              logger.traceExit(entryMessage);
      

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

        Attachments

          Activity

            People

            • Assignee:
              remkop@yahoo.com Remko Popma
              Reporter:
              mikaelstaldal Mikael Ståldal
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: