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

ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.0
    • Fix Version/s: 2.9.1
    • Component/s: Core
    • Labels:
      None

      Description

      When upgrading from 2.8.2 to 2.9.0, we are facing the following exception when accessing the context.

      Caused by: java.lang.ClassCastException: org.apache.logging.log4j.simple.SimpleLoggerContext cannot be cast to org.apache.logging.log4j.core.LoggerContext
      at org.apache.logging.log4j.core.LoggerContext.getContext(LoggerContext.java:190)
      at org.apache.logging.log4j.core.config.Configurator.setLevel(Configurator.java:291)

      Seems like that the context factory is incorrect and defaulted to SimpleLoggerContextFactory because of the provider is not able to find the resource META-INF/log4j-provider.properties which is missing in 2.9.0 if not wrong.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ralph.goers@dslextreme.com Ralph Goers
                Reporter:
                jncharpin jncharpin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: