Actually, in first go due to time constraint, we are using log4j bridge instead 
of direct log4j2 API to migrate our legacy huge code from log4j1 to log4j2.

In code we use custom FileAppender

When we Logger.getAppender(), it is returning AppenderWrapper now with the 

Get Outlook for iOS<>
From: Piotr P. Karwasz <>
Sent: Saturday, March 5, 2022 12:15:55 AM
To: Log4J Users List <>
Subject: Re: java.lang.ClassCastException: 
org.apache.log4j.bridge.AppenderWrapper cannot be cast to 

*** External email: Verify sender before opening attachments or links ***

On Fri, Mar 4, 2022 at 7:32 PM Ralph Goers <> wrote:
> I am a little surprised though as it looks like Gary added the Log4j 1.2 
> FileAppender to log4j-1.2-api but he didn’t remove the builder. If he had it 
> would have created org.apache.log4j.FileAppender as you want.

The `org.apache.log4j.FileAppender` class is useful to inherit from
it. I have successfully tested the `RollingFileAppender` from Apache
Log4j Extras as native Log4j 1.x appender (there is no builder for
this one) running through the bridge.

I don't believe we actually want to use
`org.apache.log4j.FileAppender` instead of
`org.apache.logging.log4j.core.appender.FileAppender`. I suppose that
the latter gives a better performance.


To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to