c# - Method to Log errors on Try-Catch Automatically -
I have a class that sends the exception to the database, and saves the error. But I have to keep it under every try {} my method here ..} , and because I have an error log, this is a big application, and I want to override it Hold, every time the application enters the catch, it executes my method and sends the exception and stack trace to the database. Sorry, my english is not good. PD I can develop using MVC.NET 4 razor You can use ELMAH () You can try, which tells how to integrate it with an MVC project. Alternatively, you can use log4net, but it will need to call your catch statement.