How do you handle error handling (especially SQL) in an ASP.NET project

I have another ASP.Net web project that I work in, and I approached error handling from different angles. I'm just wondering if any experienced and experienced developers had any recommendations.

Bonus points for discussing a good journal structure for ASP.net :)

+3
source share
3 answers

I used ELMAH (error logging modules and error handlers) - this is an application-level error logging tool that fully connects to several projects and works great: http://code.google.com/p/elmah/

ASP.NET 2.0: http://msdn.microsoft.com/en-us/library/ms998306.aspx

+3

, . ErrorHandler.aspx, customErrors web.config, , , , , , .

System.Exception, -, ErrorHandler.aspx, FriendlyMessage.

0

Application_Error() . Application.Log(), .

Application.Log () can be configured using the web.config file to direct output to a file, server event log, etc.

In some cases, I also implemented my own logging using common TraceSource and a custom Listener that logged messages in the database table.

0
source

Source: https://habr.com/ru/post/1702777/


All Articles