Log4j 2
  1. Log4j 2
  2. LOG4J2-723

SLF4J API classes missing from distribution

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Component/s: None
    • Labels:
      None

      Description

      The page Log4j 2 SLF4J Binding mentions under Usage that...

      Simply include the Log4j 2 SLF4J Binding jar along with the Log4j 2 jars to cause all SLF4J logging to be handled by Log4j 2.

      ...and under Requirements only that...

      The Log4j 2 SLF4J Binding requires at least Java 6 and has a dependency on the Log4j 2 API.

      But this is actually not the case since the API classes from the package org.slf4j.* are not bundled within the binding JAR.

      The solutions could either be to...

      • distribute the slf4j-api-1.x.x.jar along with the Log4J2 distribution (perhaps as log4j-slf4j-api-2.0.jar)
      • package the necessary SLF4J API classes directly into the log4j-slf4j-impl-2.0.jar) (renaming that one then simply to log4j-slf4j-2.0.jar)

      The second solution is how SLF4J handles things, how the description page above describes things and how the Commons Logging binding/bridge is supposed to work (i.e. log4j-jcl-2.0.jar) (see LOG4J2-722)

        Activity

        Hide
        Remko Popma added a comment -

        The SLF4J API classes are not included in the Log4j2 distribution by design. Users need to get those separately. If you use Maven it will pull in the necessary dependencies automatically. Otherwise you need to do this manually.

        We will update the Usage and Requirements pages to be more clear about this.

        Show
        Remko Popma added a comment - The SLF4J API classes are not included in the Log4j2 distribution by design. Users need to get those separately. If you use Maven it will pull in the necessary dependencies automatically. Otherwise you need to do this manually. We will update the Usage and Requirements pages to be more clear about this.
        Hide
        Remko Popma added a comment -

        Clarified documentation that SLF4J API jar is required when using log4j-slf4j-impl in revision 1616232.
        Please verify and close.

        Show
        Remko Popma added a comment - Clarified documentation that SLF4J API jar is required when using log4j-slf4j-impl in revision 1616232. Please verify and close.

          People

          • Assignee:
            Remko Popma
            Reporter:
            Holger Stenzhorn
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development