Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-146

Log4J 1.2 API implementation ClassCastException with SimpleLoggerContext

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta4
    • Fix Version/s: None
    • Component/s: log4j 1.2 emulation
    • Labels:
      None

      Description

      Attempting to use the Log4J 1.2 emulation API without log4j2-core results in the following error and ClassCastException on startup:

      ERROR StatusLogger Unable to locate a logging implementation, using SimpleLogger
      ...
      ... 36 more
      Caused by: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
      at org.apache.log4j.Logger.getLogger(Logger.java:43)
      ... 39 more

      The ERROR is understood, but the exception is not. Apparently, the Log4J 1.2 emulation is dependent on core, instead of just the SPI? I would not have expected this dependency.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                ssevertson Scott Severtson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: