I found out: Stopping logback-classic
Close SMTPAppender's thread pool when Tomcat shuts down
-
15-06-2023 - |
Question
I'm using Logback's SMTPAppender to send e-mails when certain logging events occur on my Tomcat.
The SMTPAppender can send e-mails asynchronously. Then however shutting down Tomcat fails because Tomcat can't close SMTPAppender's thread pool.
Is it somehow possible to close this thread pool when Tomcat is shutting down?
La solution 2
Autres conseils
if you're using Tomcat, it seems that configuring Logback's Tomcat valve should resolve this issue for you:
http://logback.qos.ch/access.html
Configuring the Valve will result in Tomcat automatically shutting down the associated ExecutorService
upon shutdown.
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow