logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Suppressing exceptions from SMTPAppender [log4j 1.3]
Date Wed, 12 Jul 2017 18:13:46 GMT

I've got an SMTPAppender logging errors, etc. and I'd like to remove the
exceptions from the log messages. Is there a good way to do that?

Remember: log4j 1.3.x (for now)

I happen to already be using a subclass of SMTPAppender that I wrote (so
only send after X number of log messages, rather than a separate SMTP
message for every log event), so I have some flexibility, there.

If it's not already in the API/config somewhere, could I simply override
the append(LogEvent) method to remove the ThrowableInformation from the
LogEvent object, then invoke the superclass's append() method?


View raw message