[logback-dev] [JIRA] (LOGBACK-1496) Add support for overriding default LogbackMDCAdapter

QOS.CH (JIRA) noreply-jira at qos.ch
Tue Jan 14 22:56:00 CET 2020


Sami Korhone created LOGBACK-1496:
-------------------------------------

             Summary: Add support for overriding default LogbackMDCAdapter
                 Key: LOGBACK-1496
                 URL: https://jira.qos.ch/browse/LOGBACK-1496
             Project: logback
          Issue Type: Improvement
          Components: logback-classic
            Reporter: Sami Korhone
            Assignee: Logback dev list
            Priority: Minor


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]



--
This message was sent by Atlassian JIRA
(v7.3.1#73012)


More information about the logback-dev mailing list