logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: [LOG4J 2] log4j-1.2-api hardcoded against log4j-core?
Date Thu, 07 Nov 2013 22:51:28 GMT
I believe there is a Jira issue requesting a fix for this.  I haven’t looked into it much
yet but I do want to see if it can be fixed.


On Nov 7, 2013, at 5:39 AM, Remko Popma <remko.popma@gmail.com> wrote:

> Hi,
> Yes, log4j-1.2-api relies on both api-2.0 and core-2.0.
> Best regards,
> Remko Popma
> On Thursday, November 7, 2013, Andreas Magnusson wrote:
>> Hi all, I'm currently prototyping a move from our proprietary logging
>> framework to log4j 2.0.
>> I've taken the route of creating a bridge from our API to log4j-api
>> (inspired by log4j-slf4j-impl) and a "server" bridge in the same way (via
>> LoggerContextFactory).
>> I then created a test application that used log4j-api, log4j-slf4j-impl,
>> log4j-jcl , jul (through slf4j), log4j-1.2-api and our own api all at once
>> to make sure that everything was translated correctly.
>> That's when I got the following exception when getting a logger through
>> log4j-1.2-api:
>> java.lang.ClassCastException: com.example.InternalContext cannot be cast to
>> org.apache.logging.log4j.core.LoggerContext
>>    at org.apache.log4j.LogManager.getLogger(LogManager.java:77)
>>    at com.example.loggingTest.Module.log4jLog(Module.java:71)
>>    at com.example.loggingTest.Module.startModule(Module.java:23)
>>    at
>> com.example.node.application.ModuleLoader$4.run(ModuleLoader.java:735)
>> Is this by design? The reason I'm asking is that the other bridges (i.e.
>> log4j-jcl and log4j-slf4j-impl) are fine with my own defined
>> LoggingContext, it's only log4j-1.2-api that has this problem. Of course
>> the plan is to use log4j-core as the framework, so it's not that big a deal
>> for me personally.
>> Other than that, great work!
>> Regards,
>> Andreas Magnusson

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

View raw message