[logback-user] SMTPAppender buffer flushed on exit?
ceki at qos.ch
Tue Sep 20 22:00:55 CEST 2011
Assuming SMTPAppender is configured with OnErrorEvaluator (the default),
then an email will be sent each time a logging event with the ERROR
level occurs. You can cause such an event to occur on system exit by
registering a shutdown hook. See Runtime.addShutdownHook.
On 20/09/2011 9:54 PM, Mark Woon wrote:
> Is there a way to get the SMTPAppender to flush/send its buffer before
> the system exits?
> If I've a buffer of 64 and my program exits, it doesn't seem to be
> sending out what's in the queue. Is there a way to either configure it
> to flush before the program exits or a hook I can call to trigger it?
QOS.ch, main sponsor of cal10n, logback and slf4j open source projects,
is looking to hire talented software developers. For further details,
More information about the Logback-user