Email notification when an error occurs

I need to create an error alert system where the network support team is notified by email when a user of our site encounters an error of any type (database exception or 404)

What would be the best way to design this section of the project? Any ideas would be appreciated.

+2


a source to share


3 answers


You might want to look into the global.asax file to catch errors at the application level. A quick search gives this step by step:

http://aspnetresources.com/articles/CustomErrorPages.aspx



Depending on the amount of traffic you expect, sending email every time you catch an error might not be the best way. At best, you would fill your mailboxes (and make the support team very unhappy), and at worst, you get your mail servers blacklisted for spamming. The approach I've used in the past on high traffic sites is to enqueue errors in a table, which is read and flushed at a given interval by a separate process. The process aggregates bugs, groups them by type, number of occurrences, etc., and then sends the report by email to the support mailing lists.

+2


a source


ASP.NET health monitoring may be of interest: http://msdn.microsoft.com/en-us/library/ms998306.aspx . It's really simpler than the first article and doesn't require any additional components - it's all built in.



+1


a source


I would implement an HTTP module that captures the onError event.
This will allow you to reuse the module across multiple applications. Destination email addresses, SMTP server, etc. Can be in the HTTP module, for maximum flexibility in the web.config file.

+1


a source







All Articles