MVC 3- Error Handling
I am trying to 开发者_如何学Cuse Elmah for handling errors in my applications with VS 2010 and MVC 3.
Did anyone used it before, could you kindly guide me the various steps involved for using it in VS 2010.
Basically how to set it up?
Thank you
Scott hanselman has something on this. The good news is that its so simple to get up and running you shouldn't need much guidance. Use nuget to install the package (it'll set up everything in the web.config correctly) and it'll start logging errors.
The only thing I think worth mentioning is if you want to catch an error but log it too then use:
try
{
....
}
catch (Exception ex)
{
Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
}
Martin
精彩评论