Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are ASP.NET Health Monitoring and ELMAH alternatives of each other?

I was going to use ELMAH for our ultimate automatic error logging but recently realized that ASP.NET Health Monitoring does a same work (perhaps). Now I want to know (please) if they are alternatives of each other just like log4net and entlib?

like image 780
Afshar Mohebi Avatar asked Feb 21 '10 05:02

Afshar Mohebi


3 Answers

ELMAH is for error monitoring, pure and simple. Easy to see the errors via a readout, RSS feeds, etc. Health monitoring is more of a full instrumentation solution.

Want the easy answer?

  • Look at how to setup Health Monitoring
  • Look at how to setup ELMAH

ELMAH is a very quick pluggable solution for error monitoring it has a very specific task (that is does beautifully). Health Monitoring is more of the shotgun see/monitor everything approach and involves much more setup work. Oh yeah, need to make a change? It's open source, grab it, change it as you like.

like image 184
Nick Craver Avatar answered Oct 22 '22 01:10

Nick Craver


I have not used Health Monitoring in ASP.NET but I have used ELMAH and it is simply amazing. It literally takes only 2 minutes to setup and then you can see all the errors. There are also so many options to display the errors. Try out ELMAH you are going to love it.

like image 42
azamsharp Avatar answered Oct 22 '22 01:10

azamsharp


ASP.NET Health Monitoring will automatically generate messages for events like app domain startup and shutdown and heartbeats and many other information about the web application. Logging frameworks don't support such features, but you can route the Health Monitoring system events to your logging framework of choice. Some frameworks even support this out of the box, such as CuttingEdge.Logging. Here is an configuration example of a CuttingEdge.Logging where the health events are forwarded to a logging provider:

<?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="logging"
      type="CuttingEdge.Logging.LoggingSection, CuttingEdge.Logging" />
  </configSections>
  <system.web>
    <healthMonitoring heartbeatInterval="0" enabled="true">
      <providers>
        <!-- We're configuring the web event provider here. -->
        <add name="LoggingWebEventProvider"
  type="CuttingEdge.Logging.Web.LoggingWebEventProvider, CuttingEdge.Logging"
          loggingProvider="DebugLogger" />
      </providers>
      <rules>
        <add name="Custom Event Provider"
           eventName="All Events"
           provider="LoggingWebEventProvider"
           profile="Default" />
      </rules>
    </healthMonitoring>
  </system.web>
  <logging defaultProvider="DebugLogger">
    <providers>
      <!-- Configure your favorite provider here. -->
      <add name="DebugLogger"
        type="CuttingEdge.Logging.DebugLoggingProvider, CuttingEdge.Logging"
        description="Debug logging provider"
        threshold="Debug" />
    </providers>
  </logging>
</configuration>
like image 26
Steven Avatar answered Oct 22 '22 01:10

Steven