Log4J SMTP 附加程序问题
我喜欢使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您关心内存,那么可以使用 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.