版权声明:本文为Boyd Wang原创文章,转载时请注明作者及本文链接
本文链接:http://www.boydwang.com/2017/07/elmahr-introduction/

What’s Elmah

Elmah stands for Error Logging Modules and Handlers and is used to log unhandled exceptions to the file system, event log, databases or even have it email you the errors.

What’s ElmahR (ElmahR = Elmah + SingalR)

ElmahR is a web dashboard where you can aggregate several monitored applications; adding them to ElmahR configuration will enable them to post error events, which will show them on all the connected client dashboards in real-time.ElmahR is about error logging in real-time, and to do that it’s based on ELMAH for the ‘error logging’ part and on SignalR for the ‘real-time notification’ piece.ElmahR is an open source project which is assembled from several other open sources projects, trying to find the right Lego pieces to reach its goal. YSOD = Yellow Screen of Death

Url

Elmah & Dashboard

Module

ErrorLog

ErrorEmail

ErrorFilter

The following markup instructs ELMAH to not log 404 errors.

We can also implement it by code, add below code to Global.asax

ErrorPost

Log type

in Memory

XML

SqlLite

SQL Server

Rss

Setup

Create a brand new web application, mvc or normal web app works fine.

Using Nuget add the following packages to your blank MVC solution, so add Elmah and JQuery.

Install Elmah

When finished, the below code will be added to the web.config

Install ElmahR.core + ELmahR.DashBoard

When finished, the below code will be added

Change it to

Add a declaration of the application:

How to add another site to Dashboard

Create another site

Run below command:

Modify the node to

Add annode to host’s web.config

ThesourceId must match the one in<errorPost>

<system.web> & <system.webserver>

system.web is for Classic Mode. system.webserver is for Integrated Pipeline Mode (available in IIS7+).

How to add a module

1. Add a handler to SectionGroup

2. Add a module to modules

3. Add element to elmah

References

ElmahR – Elmah fused With SignalR
Config ElmahR
ElmahR Wiki
ELMAH – Error Logging Modules And Handlers
Logging Errors with ELMAH in ASP.NET MVC 3 – Part 3 – (Filtering)



打赏
Categories: C#程序开发

Boyd Wang

想给自己贴上各种NB的头衔,NB程序员,NB自由职业者,最后发现自己其实是个Newbie,没办法,慢慢来吧

Leave a Reply

Your email address will not be published. Required fields are marked *

无觅相关文章插件,快速提升流量