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

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

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 2.0.0-alpha2
    • Component/s: log4j-over-slf4j
    • Labels:
      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

            • Assignee:
              slf4j-dev SLF4J developers list
              Reporter:
              rufoa Rufus Andrews
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: