Re: Wrapped exceptions

Ralph Goers <[email protected]> Thu, 4 Apr 2024 12:01:20 -0700
Newsgroups gmane.comp.jakarta.log4j.user
Message-ID <[email protected]>
I really have no idea why but this is the first time I have heard someone ask for the ability to filter based on the Exception class.

We haven’t implemented a Filter to do this but I would imagine it could easily be done. I would imagine it would:
a) let you specify a list of Exception classes and the Filter Result on a match or mismatch.
b)  allow the Result to be specified if no Exception is in the LogEvent.

Ralph

> On Apr 4, 2024, at 8:20 AM, Robert Egan <[email protected]> wrote:
> 
> I am currently working with an application that wraps every exception in a
> general exception. The problem is, there are some errors I can address
> (configuration errors, user errors, etc) and some I cannot address (network
> errors, database errors, etc). But they are all wrapped in the general
> exception.
> 
> I would like to ACCEPT only on the wrapped exceptions I can address and
> DENY the ones I cannot address. Can this be done simply through the log4j2
> configuration files, or will I need to create a custom filter?
> 
> Robert Egan