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

Add support for overriding default LogbackMDCAdapter

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 1.3.0-alpha11
    • Component/s: logback-classic
    • Labels:
      None

      Description

      Currently LogbackServiceProvider creates instance of MDCAdapter using new operator.

      If a MDCAdapter was created using ServiceLoader and LogbackMDCAdapter was set as default provider, if no other was found, frameworks (such as spring webflux) could override default implementation of MDCAdapter.

      Proposed change would allow frameworks to support MDC that is bound to request rather than to currently executing thread. Currently users are forced to rebind either use mapped diagnostic context other than MDC or to bind variables for every logging event

      Code that needs to be changed:

      https://github.com/qos-ch/logback/blob/b5baeb47bacdd64190d1c10f119f810b39773d95/logback-classic/src/main/java/ch/qos/logback/classic/spi/LogbackServiceProvider.java#L42

        Attachments

          Activity

            People

            Assignee:
            logback-dev Logback dev list
            Reporter:
            skorhone Sami Korhone
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: