我正在寻找在ASP.NET应用程序中记录错误的最佳方式。 我希望能够在我的应用程序中发生错误时收到电子邮件,并提供有关异常和当前请求的详细信息。
在我公司,我们使用拥有自己的ErrorMailer,捕获Global.asax Application_Error中的所有内容。这是Ok,但不是非常灵活或不可配置。
我们最近切换到NLog。它更可配置,我们可以为错误定义不同的目标,过滤它们,缓冲它们(尚未尝试)。这是一个非常好的改进。
但是我最近发现在.Net框架中有一个完整的命名空间用于此目的: System.Web.Management ,它可以在 healthMonitoring 部分的web.config。
$ b $你曾经与.Net健康监控工作吗? 解决方案我使用 elmah 。它有一些非常好的功能,这里是一个 CodeProject 文章。我认为StackOverflow团队也使用elmah!
I'm looking for the best way to log errors in an ASP.NET application. I want to be able to receive emails when errors occurs in my application, with detailed information about the Exception and the current Request.
In my company we used to have our own ErrorMailer, catching everything in the Global.asax Application_Error. It was "Ok" but not very flexible nor configurable.
We switched recently to NLog. It's much more configurable, we can define different targets for the errors, filter them, buffer them (not tried yet). It's a very good improvement.
But I discovered lately that there's a whole Namespace in the .Net framework for this purpose : System.Web.Management and it can be configured in the healthMonitoring section of web.config.
Have you ever worked with .Net health monitoring? What is your solution for error logging?
解决方案I use elmah. It has some really nice features and here is a CodeProject article on it. I think the StackOverflow team uses elmah also!
更多推荐
如何在ASP.NET应用程序中记录错误(异常)?
发布评论