Yeah.  You can't do that.
I had that problem too - you have to find a new way to do in log4j.
I can't look now, but I will find what I did and post it tomorrow.

Don't waste time trying to find a similar mechanism - it was something
rather different.

On Fri, Aug 12, 2022 at 6:18 PM Gary Gregory <garydgreg...@gmail.com> wrote:

> Joel,
>
> Is it possible to use Log4j 2's much richer feature set as is? Perhaps you
> could explain what is it your old appender does that requires custom code.
>
> Gary
>
> On Fri, Aug 12, 2022, 15:35 Joel Griffith <jgrif...@nd.edu> wrote:
>
> > I have a Java application containing a package written to use Log4j v1.
> I
> > am struggling to update this package to use Log4j v2 to remediate its
> > security vulnerabilities.
> >
> > The package contains a custom Appender that subclasses Log4j v1's
> > FileAppender.  I am stumped at how to convert this file to Log4j v2.  In
> > Log4j v2, the FileAppender class is 'final' and cannot be subclassed, so
> I
> > cannot create a new version of the custom Appender that mirrors the
> first.
> > More importantly, perhaps, is that the Log4j v2 FileAppender is a Plugin
> > and completely different in structure from the Log4j v1 FileAppender.
> >
> > I found this page that ostensibly explains how to extend Log4j:
> > https://logging.apache.org/log4j/2.x/manual/extending.html#Appenders
> > but it contains no information about actually extending Appenders or
> > procedures for accomplishing an equivalent goal.
> >
> > Is there any reasonable way of converting this custom Appender from Log4j
> > v1 to v2?
> >
> > Thanks,
> > Joel
> >
>


-- 
   ☮

Reply via email to