Presentation is loading. Please wait.

Presentation is loading. Please wait.

Created by Atif Aziz. ELMAH means is "Error Logging Modules and Handlers". It is an application-wide error logging facility that is completely pluggable.

Similar presentations


Presentation on theme: "Created by Atif Aziz. ELMAH means is "Error Logging Modules and Handlers". It is an application-wide error logging facility that is completely pluggable."— Presentation transcript:

1 Created by Atif Aziz. ELMAH means is "Error Logging Modules and Handlers". It is an application-wide error logging facility that is completely pluggable. It can be dynamically added to a running ASP.NET web application. Provides different log storing options including in memory, SQL Server, SQL Lite.

2 ELMAH enables logging of all unhandled exceptions. ELMAH has functionality to download all errors in CSV file. RSS feed for the last 15 errors. Get all error data in JSON or XML format. Get all errors to our mailbox. Customize the error log by customizing some code.

3  Open NuGet Package Manager.  Install ELMAH.MVC

4  Open web.config file and add the following code inside  Adding a http handler to view exception.

5  Add the following code inside  Adding a http module to log exception.

6  Here I am using SQL Server database to log the exception.  We have to create a table “ELMAH_Error”.

7  After creating Table we need to write store procedure for ELMAH.  We have to write 3 store procedure for ELMAH.

8  Open web.config file, add the following code inside in  To set the logger type & other section.

9  Let’s create some Exception.

10  Create divide by zero exception in contact page.

11  We can view the error log web page through the url localhost:portno/elmah.axd like, localhost: 59969/ elmah.axd.

12  Check the error log in database.

13  Raise an exception using ErrorSignal class of ELMAH.

14  To store the Log messages in XML files add the following code to section of the web.config  If any error occurred then exceptions will be stored in the database and also in XML file.(App_data -> Elmah)

15  XML file be like


Download ppt "Created by Atif Aziz. ELMAH means is "Error Logging Modules and Handlers". It is an application-wide error logging facility that is completely pluggable."

Similar presentations


Ads by Google