This is a bit tricky, the API is typed to return an Appender and that's
what we do, not only that but it is an Appender that behaves properly IIRC.
If we returned the wrapped Log4j 1 Appender and you call it, the wrong
thing will happen IIRC.

Gary

On Sat, Mar 5, 2022, 15:02 Piotr P. Karwasz <piotr.karw...@gmail.com> wrote:

> Ralph,
>
> On Sat, Mar 5, 2022 at 6:21 PM Ralph Goers <ralph.go...@dslextreme.com>
> wrote:
> > Even if getAppender() were to bypass the AppenderWrapper it would still
> return
> > org.apache.logging.log4j.core.appender.FileAppender, not
> org.apache.log4j.FileAppender.
> > Are you proposing that getAppender return a proxy for
> org.apache.log4j.FileAppender?
>
> No, my proposition doesn't apply to this case. If a user wants to use
> a standard Log4j 1.x appender, he should get an AppenderWrapper of the
> corresponding Log4j 2.x appender: the Log4j 1.x emulation must have
> its limits.
>
> However if a user wants to use a custom appender extending
> `org.apache.log4j.FileAppender`, then `getAppender` returns an
> AppenderWrapper of an AppenderAdapter of the custom appender.
> Converting back and forth between Log4j 1.x appenders and Log4j 2.x
> appenders is a little bit too much. `getAppender` should just return
> the custom appender.
>
> Piotr
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
>
>

Reply via email to