警报/警告电子邮件通知应该从应用程序内部发送还是通过日志分析器发送?

发布于 2024-11-13 10:56:20 字数 162 浏览 6 评论 0原文

哪个“更好”:

  1. 将重要事件(关键问题等)的电子邮件通知构建到我的应用程序(套接字服务器)中。
  2. 构建/使用日志分析器来查看应用程序日志的每一行,检查某些条件并启动脚本来发送电子邮件。

如果第二个“更好”,我可以使用哪些工具来做到这一点。

Which is "better":

  1. Build e-mail notifications for important events (critical problems and stuff) into my application (a socket server).
  2. Build/use a log analyzer to look into each line of the application log checking for some conditions and firing up a script to send emails.

If the second is "better", which tools can I use to do this.

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

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

发布评论

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

评论(2

夏九 2024-11-20 10:56:20

我只会使用 log4net,其中包含 SmtpAppender

它带有许多不同的附加程序,因此您可以非常轻松地将其配置为 ie。将所有信息消息转储到文件,将警告和错误转储到数据库,并仅针对错误发送电子邮件通知。

您可以更改配置,而无需更改源代码。

I would just use log4net, which includes an SmtpAppender.

It comes with many different appenders so you can very easily configure it to ie. dump all info messages to file, warnings and errors to database and send an email notification for errors only.

You can change the configuration without any changes to the source code.

疧_╮線 2024-11-20 10:56:20

老实说,我编写了自己的电子邮件通知系统。学习如何做到这一点实际上很有用,此外,您还可以编写应用程序的一部分来检查日志,并通过立即发送重大事件的电子邮件通知(其中您可以使用电子邮件通知)来做到“两全其美”您可以多次重用的代码通知模型,这是任何项目的最终结果,对吗?即编写可以在项目的其他领域重用的代码)。

简短版本:两者都有。只是我的建议。

I honestly write my own email notification systems. It's actually useful to learn how to do this, in addition you could write part of your app to check the log as well and do the "best of both worlds" by doing immediately email notification of major events (of which you can use an email notification model of code that you can reuse multiple times, which is the end result of any project right? :) i.e. to write code that can be reused in other realms of your project).

The short version: Both. Just my suggestion.

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