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

Add support for overriding default LogbackMDCAdapter

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • 1.5.12
    • None
    • logback-classic
    • 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

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

            Dates

              Created:
              Updated: