3

I have been reading so many different posts the last hour. I cannot simply find one, start to finish article / tutorial on how to wire up elmah to do the following in asp.net web api 2:

  1. Which nuget package to install
  2. Log ALL exceptions, 500, 404 , 200 etc in controller and pipeline space
  3. Store Exception In SQL or Memory
  4. View the exceptions at /elmah.axd
  5. Email Exceptions to email address.

I seem to have found bits and pieces of this all over the net, but not one that ties them all together. And if I must be honest I have not come right with it either.

1 Answer 1

2

Here's the Nuget package you need to install:

https://www.nuget.org/packages/Elmah.Contrib.WebApi/

Check out the project site on github for this library. This library simply provides an ASP.NET Web API exception filter for Elmah. Elmah setup is pretty much standard. For setting up DB logging etc go the Elmah project site and read out the documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

You might be my new best friend with this. I couldn't get Elmah to log for anything until I came across this post, installed the above and now it's perfect. Thank you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.