Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elmah and ASP.NET MVC 3

What are the steps required to set up elmah on an ASP.NET MVC 3 application?

  1. nuget elmah
  2. customize elmah (storage, etc)
  3. handle HandleError

Is that all? Is step 3 still necessary after nuget?

like image 875
Endy Tjahjono Avatar asked Jun 27 '11 10:06

Endy Tjahjono


People also ask

What is Elmah MVC?

ELMAH (Error Logging Modules and Handlers) is a series of HTTP modules and an HTTP handler that may be added to your ASP.NET web applications for the purpose of tracking unhandled exceptions. ELMAH provides access to view these errors by way of a web console, email notifications. It is open-source error logging system.

Does Elmah work with .NET core?

elmah.io for ASP.NET Core supports a range of actions for hooking into the process of logging messages. Hooks are registered as actions when installing the elmah.io middleware: services.

What is logger in ASP NET MVC?

It is an open source framework. Log4net provides a simple mechanism for logging information to a variety of sources. Information is logged via one or more loggers. These loggers are provided at the below levels of logging: Debug.

How do I view Elmah logs?

This error log is accessible from the web page elmah. axd from the root of your website, such as http://localhost/BookReviews/elmah.axd .


1 Answers

Taken from : HOW TO SETUP ELMAH.MVC WITH ASP.NET MVC 4 ?

What is Elmah ?

ELMAH is an open source project whose purpose is to log and report unhandled exceptions in ASP.NET web applications.

Why to use Elmah ?

ELMAH serves as an unobtrusive interceptor of unhandled ASP.NET exceptions, those usually manifesting with the ASP.NET yellow screen of death.

So now we know what and why to use Elmah, Lets quickly get started on how to use Elmah with your ASP.NET MVC project.

Step 1: Right click on your solution and select the "Manage Nuget Packages" option enter image description here

Step 2: In the Nuget Package manager search for "Elmah" and install the Elmah.MVC nuget extension. enter image description here The Nuget Package manager will download and add the required dlls and modify the web.config's <appSetting> for Elmah to woenter image description hererk.

Step 3: That's it !! Your Elmah is now ready to test. I have generated a 404 to test if my Elmah works, ELMAH can be accessed by this url : http://yourapp.com/elmah. enter image description hereenter image description here

Hope this helps :)

Further Reading :

  • Elmah on code.google.com
  • Elmah.MVC 2.0.2 on Nuget
  • Elmah.MVC on GitHub
like image 70
Yasser Shaikh Avatar answered Sep 17 '22 12:09

Yasser Shaikh