Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 logback 中,SMTP 是异步发送的(显然应该如此),但是在我的测试中,如果应用程序关闭,这些电子邮件似乎会被取消。这非常不好,因为我需要通知我我的应用程序遇到了致命错误 - 这实际上是最糟糕的不接收电子邮件的时间。这该怎么做?
通过同步发送高级、重要的电子邮件而不是在单独的守护线程上实现这一点,logback 正确地默认执行。
在附加程序中:
<asynchronousSending>false</asynchronousSending>