Log4J SMTP 附加程序问题

发布于 2024-09-27 02:17:09 字数 109 浏览 0 评论 0原文

我喜欢使用 log4j smtp 附加程序,我怀疑当它尝试发送太多电子邮件时它会对我的应用程序内存产生影响。发送之前错误位于何处(内存或其他)? 如果应用程序崩溃,那么我是否会丢失任何尚未发送的“错误”?

I like to use log4j smtp appender and i doubt is it effect to my application memory when it's tries to send too many emails.And where errors located (memory or other) before send?
If application crashes then do i lost any "Errors" that not send yet?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜灵血窟げ 2024-10-04 02:17:09

如果您关心内存,那么可以使用 JDK 中的“jvisualvm”进行调查。

邮件的内容以及生成邮件所需的事件存储在内存中。我鼓励您研究源代码。

如果您的应用程序退出 JVM,则无法执行更多操作,但应该立即发送有错误的邮件。如果您担心这一点,请考虑添加要在 JVM 关闭时运行的关闭挂钩。

If you are concerned with memory then investigate with e.g. "jvisualvm" in the JDK.

The contents of the mail and the events needed to generate it are stored in memory. I encourage you to investigate the source code.

If your application exits the JVM no more actions can be taken, but mails with errors should have been sent immediately. If this is a concern to you, then consider adding shutdown hooks to be run when the JVM is shutting down.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文