Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-1765

MDC Properties Not Associated with Log Statements

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.4.8, 1.4.9, 1.4.11
    • logback-classic
    • macOS Ventura 13.6.2

      OpenJDK 17.0.8

      Spring Boot 3.1.3

    Description

      Starting from version 1.4.8 of Logback, an issue has been observed where MDC properties are no longer associated with log statements when a custom MDCAdapter, for instance com.twitter.inject.logging.FinagleMDCAdapter, is set in the application.

      The likely root cause is that, beginning with version 1.4.8, Logback obtains the MDCAdapter from {{ch.qos.logback.classic.LoggerContext}} instead of directly getting it from MDC. Consequently, the application ends up using two separate and independent MDCAdapters concurrently.

      You can find a simplified application created to reproduce this issue in the following repository: https://github.com/naser-ayat/logback-bug-reproducer

       

      Attachments

        Activity

          People

            logback-dev Logback dev list
            naser.ayat Naser Ayat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: