You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by 耿渊哲 <ge...@gmail.com> on 2020/11/22 05:31:11 UTC
【 LOG4J2-2927】 support customizing error handler, need help
Hi all,
I’m working on the LOG4J2-2927 and try to allow users the ability to
customize how to handle errors.
Now I’m working on building the DefaultErrorHandler plugin. But unlike
other plugins, the DefaultErrorHandler has a parameter named appender,
which should be the parent element of it. And in the DefaultErrorHandler,
appender.ignoreExceptions() will be evaluated to decide if Exception should
be thrown when error occurs.
The appender configuration is like this:
<AlwaysFail name="failAppender">
<DefaultErrorHandler/>
</AlwaysFail>
I don't know how to set the failAppender to the appender field of
DefaultErrorHandler. What do you think this way:
<AlwaysFail name="failAppender">
<DefaultErrorHandler>
<AppenderRef ref="failAppender"/>
</DefaultErrorHandler>
</AlwaysFail>
Any advice?