Uploaded image for project: 'SLF4J'
  1. SLF4J
  2. SLF4J-432

log4j-over-slf4j calls wrong methods when marker parameter is null

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • 2.0.0-alpha2
    • None
    • log4j-over-slf4j
    • None

    Description

      The org.slf4j.Logger interface has with-Marker and without-Marker versions of each logging method,

      e.g.
      public void trace(Marker marker, String format, Object arg);
      vs
      public void trace(String format, Object arg);

       

      However, the differentiatedLog method in log4j-over-slf4j ignores this and always calls the method with the Marker argument, even when there is no Marker. Logger implementations are then forced to defensively check for null Markers because of this error.

      log4j-over-slf4j should instead call the correct (without-Marker) method when there is no Marker.

       

      Patch: https://github.com/qos-ch/slf4j/pull/190/

      Attachments

        Activity

          People

            ceki Ceki Gülcü
            rufoa Rufus Andrews
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: