Hari Gillala
Hari Gillala

Reputation: 11916

MVC 3- Error Handling

I am trying to use 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

Upvotes: 0

Views: 262

Answers (1)

Martin Booth
Martin Booth

Reputation: 8595

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

Upvotes: 2

Related Questions