ASP.NET 运行状况监控和 ELMAH 是否可以相互替代?
我本来打算使用 ELMAH 来实现最终的自动错误日志记录,但最近意识到 ASP.NET 运行状况监控(也许)可以完成相同的工作。现在我想知道(请)它们是否可以像 log4net 和 entlib 一样互相替代?
I was going to use ELMAH for our ultimate automatic error logging but recently realized that ASP.NET Health Monitoring does a same work (perhaps). Now I want to know (please) if they are alternatives of each other just like log4net and entlib?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
ELMAH 用于错误监控,纯粹而简单。通过读数、RSS 提要等可以轻松查看错误。健康监控更像是一个完整的仪器解决方案。
想要简单的答案吗?
ELMAH 是一种非常快速的可插拔解决方案,用于错误监控 它有一个非常具体的任务(做得很漂亮)。健康监控更像是一种“霰弹枪”查看/监控一切的方法,并且涉及更多的设置工作。哦,是啊,需要改变吗?它是开源的,抓住它,随心所欲地改变它。
ELMAH is for error monitoring, pure and simple. Easy to see the errors via a readout, RSS feeds, etc. Health monitoring is more of a full instrumentation solution.
Want the easy answer?
ELMAH is a very quick pluggable solution for error monitoring it has a very specific task (that is does beautifully). Health Monitoring is more of the shotgun see/monitor everything approach and involves much more setup work. Oh yeah, need to make a change? It's open source, grab it, change it as you like.
我没有在 ASP.NET 中使用过健康监控,但我使用过 ELMAH,它简直太神奇了。实际上只需要 2 分钟即可完成设置,然后您就可以看到所有错误。还有很多选项可以显示错误。尝试一下 ELMAH,您一定会喜欢的。
I have not used Health Monitoring in ASP.NET but I have used ELMAH and it is simply amazing. It literally takes only 2 minutes to setup and then you can see all the errors. There are also so many options to display the errors. Try out ELMAH you are going to love it.
ASP.NET 运行状况监控将自动生成应用程序域启动和关闭、心跳等事件的消息以及有关 Web 应用程序的许多其他信息。日志记录框架不支持此类功能,但您可以将运行状况监控系统事件路由到您选择的日志记录框架。有些框架甚至开箱即用地支持这一点,例如 CuttingEdge.Logging。以下是 CuttingEdge.Logging 的配置示例,其中运行状况事件被转发到日志记录提供程序:
ASP.NET Health Monitoring will automatically generate messages for events like app domain startup and shutdown and heartbeats and many other information about the web application. Logging frameworks don't support such features, but you can route the Health Monitoring system events to your logging framework of choice. Some frameworks even support this out of the box, such as CuttingEdge.Logging. Here is an configuration example of a CuttingEdge.Logging where the health events are forwarded to a logging provider: