[ 
https://issues.apache.org/jira/browse/LOG4J2-2664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Volkan Yazici closed LOG4J2-2664.
---------------------------------

> log4j-1.2 compatibility layer seems to rely on log4j-core . It shouldn't
> ------------------------------------------------------------------------
>
>                 Key: LOG4J2-2664
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2664
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>    Affects Versions: 2.12.0
>            Reporter: Alexander Picoli
>            Priority: Blocker
>
> I've just got a surprise that was a showstopper to me: It seems that log4j 
> 1.2 compatibility layer demands log4j core for working well:
> In our project, we are trying to use another spi that wraps around log4j 2 , 
> so that some specific features can be enforced.
> However, when I try to use log4j 1.2 compatibility layer, it fails:
>  
> Exception in thread "main" java.lang.ClassCastException: 
> com.ibm.is.poclog4j.commonconfig.MandatoryAppendersLoggerContext incompatible 
> with org.apache.logging.log4j.core.LoggerContext
>     at org.apache.log4j.Logger$PrivateManager.getContext(Logger.java:59)
>     at org.apache.log4j.Logger.getRootLogger(Logger.java:45)
>     at com.ibm.is.poclog4j.sample.SampleLogUser.main(SampleLogUser.java:9)
>  
> The issue is there: org.apache.logging.log4j.core.LoggerContext : you 
> shouldn't count with a core-based context, or else you violate the API 
> contract, forcing people to use a specific implementation for log4j (in this 
> case, the default core one).
> My SPI uses the spi-provided interface for LoggingContext: 
> import org.apache.logging.log4j.spi.LoggerContext;
> public class MandatoryAppendersLoggerContext implements LoggerContext {
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to