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

Unchecked definition in LogbackMDCAdapter breaking custom adapters

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.4.2, 1.4.3, 1.4.4
    • logback-classic
    • None

    Description

      Hi, 

      Starting with 1.4.2 I spotted an issue when defining a custom `LogbackMDCAdapter`.

      In short, this change https://github.com/qos-ch/logback/commit/7e3e2ae770c19724b0714c7f48fd33bbc6791c7e#diff-e5a738c3ab37fbeacbb433d7d7171c51c6058623c377c8549191ad47ca5020f3R177 changed the definition of the `setContextMap` to be unchecked (`Map` vs. `Map<String, String>`).

      This is breaking custom adapters in Scala. I setup a minimal repro here: https://github.com/AL333Z/logback-issue/blob/main/src/main/scala/MyLogbackAdapter.scala#L5-L12

       

      Restoring the definition to be `public void setContextMap(Map<String, String> contextMap)` should restore the functionality.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            al333z Alessandro Zoffoli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: