Global.asax notification when an unhandled error occurs?
on my production server sometimes we get server error due to some time out issues.
I would like to receive a notification to my Phone or email as soon as my server is down.
How can i do that? I guess i have to write a function on global.asax
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code tha开发者_运维百科t runs when an unhandled error occurs
End Sub
my server is on Windows 2008 R2
.Net Framework 3.5 VB.Net
Any help would be greatly appreciated.
Thanks
You can leverage existing logging modules to handle this for you. For example, you can simply add Error Logging Modules and Handlers for ASP.NET to your solution and not change a single line of code. You configure elmah in your web.config and it can send you emails automatically when unhandled exceptions occur.
The web based error page from elmah is also very nice during development.
精彩评论