logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Duane <nic...@msn.com>
Subject Appender's append() method
Date Wed, 13 Jan 2016 21:38:05 GMT
I'm new to java so maybe this should be an obvious question to most java developers.  If I'm
trying to override the append() method but also throw exceptions, how is that done?

I'm asking because I assume my append method's outermost catch block is to inspect the ignoreExceptions
flag and either bubble up the exception if ignoreExceptions is false or eat the exception
otherwise, most likely just logging an event.  Is that true?  If so, then how do I accomplish
that?  I tried coding it as I mentioned above (actually someone else did it for me), but the
compiler I guess was complaining about the throw needing to be in a catch block, I assume
because the append() method is not defined to throw exceptions.

In addition, looking at what I think was source for one of your appenders at:


Why does it always throw an exception in the catch block instead of checking the state of
the ignoreExceptions flag?

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message