문제

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?

도움이 되었습니까?

해결책

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?

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.

다른 팁

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.

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top