You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Ralph Goers (JIRA)" <ji...@apache.org> on 2019/07/24 20:05:00 UTC
[jira] [Resolved] (LOG4J2-2664) log4j-1.2 compatibility layer seems
to rely on log4j-core . It shouldn't
[ https://issues.apache.org/jira/browse/LOG4J2-2664?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Ralph Goers resolved LOG4J2-2664.
---------------------------------
Resolution: Duplicate
Resolving this as a duplicate. If you can look at the linked issue and figure out how to deal with the stuff in Log4j 1.x that requires the actual implementation that would go a long way to getting this addressed.
> 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
(v7.6.14#76016)