[
https://issues.apache.org/jira/browse/LOG4J2-167?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13580515#comment-13580515
]
Eric Schellhammer commented on LOG4J2-167:
------------------------------------------
I tried to use it as part of an Eclipse plugin project. That's probably the
reason behind the configuration issues, since the same class runs smoothly as a
Java application. (I even tried to set the system property
"log4j.configurationFile", but the static part of LogManager gets run before
the system property is recognized.)
On the other hand, whatever the reason for reaching the else-branch in the
static part of LogManager, the problem leading to the exception is the fact
that SimpleLoggerContext implements an interface named LoggerContext
(spi.LoggerContext) but gets cast to a class that is also named LoggerContext
(core.LoggerContext) but is incompatible.
> ClassCastException from SimpleLoggerContext to core.LoggerContext, since it
> implements spi.LoggerContext
> --------------------------------------------------------------------------------------------------------
>
> Key: LOG4J2-167
> URL: https://issues.apache.org/jira/browse/LOG4J2-167
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0-beta5
> Reporter: Eric Schellhammer
>
> When calling Configurator.initialize(<Name>, null, <File>) it calls
> LogManager.getContext(loader, false) and if no logging implementation can be
> found this method returns a new SimpleLoggerContext (created by the factory
> which in turn is created in the static part of the class). This class
> implements spi.LoggerContext but the Configurator tries to cast it to
> core.LoggerContext, which fails since SimpleLoggerContext does not extend
> that class.
--
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: [email protected]
For additional commands, e-mail: [email protected]