Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: logback-classic
    • Labels:
      None

      Description

      After LOGBACK-620, the MDC map is no longer in InheritableThreadLocal.

      So when you MDC.put on a thread if you create a new thread from it, the new thread will not receive the value.

      I think the LOGBACK-620 was about not copying the map on each thread creation but only when it the map is modified, but the lost of inherited value was unexpected.

      If so replacing

      final ThreadLocal<Map<String, String>> copyOnThreadLocal = new ThreadLocal<Map<String, String>>();

      by 

      final ThreadLocal<Map<String, String>> copyOnThreadLocal = new InheritableThreadLocal<Map<String, String>>();

      will do the fix

        Attachments

          Activity

            People

            • Assignee:
              logback-dev Logback dev list
              Reporter:
              gaellalire Gael Lalire
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: