XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • logback-classic
    • 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

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

            Dates

              Created:
              Updated: