1

Q:

While i was asking about an issue concerning the exception handling,i find many articles about how to deal with exceptions:

My question has three parts:

1- I read about ELMAH - Error Logging Modules And Handlers.

through two articles this and this.but it doesn't work with me,although the simplicity of its configuration .The yellow death screen still appear to me!.

Notes:

  • I try the code locally in development environment not in the production environment.

  • I'm so confused about /admin/elmah.axd, is it exist physically or not.

  • I use web application not a web site.and .net 3.5


2- Is the ELMAH the best choice or I should use Health Monitoring instead ?or can i use the both?


3- If i use ELMAH ,Is this enough , and i don't need to Error folder and custom errors anymore.?

Anyname Donotcare
  • 11,113
  • 66
  • 219
  • 392

4 Answers4

1

ELMAH is way more powerful than Health Monitoring. You don't need Health Monitoring if you have ELMAH.

You still need a custom error page, to show a pretty page to the end user. I don't know what you mean by an "Error folder", but you don't need it.

Any problems you are encountering are probably answered here: "Resource not found" error while accessing elmah.axd in ASP.NET MVC project

Community
  • 1
  • 1
Justin M. Keyes
  • 6,679
  • 3
  • 33
  • 60
1

My understanding of ELMAH is that it is a way to capture errors that your application may be missing, and allow you to review them later. So you still need custom error pages if you want your users to see something other than the yellow screen of death.

The /admin/elmah.axd is a HttpHandler that does not have a physical file on disk, but instead gives you an administrative console to the errors that have been captured by ELMAH.

I've not used Health Monitoring, so I cannot speak to it directly. I would say use whichever tool is easiest for you to use, and provides all the information you need. You could probably use both for a while and see if one is a better fit for your needs than another (though I don't know if they might step on one another or not).

ckramer
  • 9,419
  • 1
  • 24
  • 38
1

If you won't succeed configuring ELMAH or want to have more control on error hadling\logging, may be you'll want to consider creating your custom error handling module, which is quite simple. Here you can find a nice tutorial with example code.

Kirill
  • 3,028
  • 1
  • 17
  • 18
1

One advantage of using Health Monitoring is that you can log any event from the System.Web.Management namespace, not only runtime errors.

That means that you can also log other events such as configuration errors, application restarts, failed and successful security events and more.

EDIT - AS THE FOLLOWING WAS TOO LONG FOR A COMMENT

Health Monitoring is a part of the .NET framework that, through classes in the System.Web.Management namespace, lets you log events related to just about all aspects of your application. ELMAH on the other hand is a plugin that itself uses various classes in the .NET framework for logging purposes.

That means that you cannot compare the two directly. You would have to compare ELMAH to a third party plugin that uses the System.Web.Management for logging purposes (such as Spot a fault - the one I currently work with).

To set up and use such a plugin is pretty straight forward. To create your own Health Monitoring based logging setup is a bit harder as documentation is a bit thin, but with a bit of time to spend, should cause no problem.

Lasse
  • 251
  • 1
  • 4
  • Is using `Health Monitoring`, easy like `ELMAH`,or it needs much effort. please any resources to help me in the beginning if possible.thanks a lot. – Anyname Donotcare Jul 12 '11 at 14:29