开发者

Global.asax notification when an unhandled error occurs?

开发者 https://www.devze.com 2023-04-13 00:10 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号