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

ThreadContext for Asynchronous logger in multithreaded environmant is overwriting the values.

    XMLWordPrintableJSON

Details

    • Question
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.0-rc1
    • None
    • API
    • java 7

    Description

      ThreadContext for Asynchronous loggers in multithreaded environmant is overwriting the values. Is there is any way to use the custom key value pairs in such an environment?

      The log4j2 document says that the values in threadcontext may overwrite by asynchronous logging in multithreaded envirnment. We are implemented the log4j2 asynchronous logging in our single sign on (SSO) framework and the threadcontext is used to store some parameter values like sessionId, firm, user etc and these values needs to be included in the log entry. At a time many users will log into our site by using SSO. Is the threadcontext values will change by asynchronous logging in multithreaded envirnment? If so, is there any other way to store these values in thread safe manner?

      Log4j2 will not modify this. that is OK. But when many users at a time uses single sign on then what will happen to the key value pairs in the threadcontext. Is they will modify in multithreaded environment by asynchronous logger?

      Attachments

        Activity

          People

            Unassigned Unassigned
            sivan sivan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: