You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2013/01/17 09:56:13 UTC

[jira] [Comment Edited] (LOG4J2-146) Log4J 1.2 API implementation ClassCastException with SimpleLoggerContext

    [ https://issues.apache.org/jira/browse/LOG4J2-146?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13555992#comment-13555992 ] 

Ralph Goers edited comment on LOG4J2-146 at 1/17/13 8:55 AM:
-------------------------------------------------------------

I'm not sure if this can be fixed but I will investigate it.  The Log4j 1.2 bridge has methods on the Category such as getting the parent logger that are currently implemented but would have to be noops if they go to the Log4j 2 API only. FWIW if you build the site you would now see that the Log4j 1.2 bridge says it needs both the API and implementation.
                
      was (Author: ralph.goers@dslextreme.com):
    I'm not sure if this can be fixed but I will investigate it.  The Log4j 1.2 bridge has methods on the Category such as getting the parent logger that are currently implemented but would have to be noops if they go to the Log4j 2 API only.
                  
> Log4J 1.2 API implementation ClassCastException with SimpleLoggerContext
> ------------------------------------------------------------------------
>
>                 Key: LOG4J2-146
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-146
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>    Affects Versions: 2.0-beta4
>            Reporter: Scott Severtson
>            Priority: Minor
>
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org