ASP.NET 运行状况监控和 ELMAH 是否可以相互替代?

发布于 2024-08-22 07:24:01 字数 112 浏览 8 评论 0原文

我本来打算使用 ELMAH 来实现最终的自动错误日志记录,但最近意识到 ASP.NET 运行状况监控(也许)可以完成相同的工作。现在我想知道(请)它们是否可以像 log4net 和 entlib 一样互相替代?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

淑女气质 2024-08-29 07:24:01

ELMAH 用于错误监控,纯粹而简单。通过读数、RSS 提要等可以轻松查看错误。健康监控更像是一个完整的仪器解决方案。

想要简单的答案吗?

ELMAH 是一种非常快速的可插拔解决方案,用于错误监控 它有一个非常具体的任务(做得很漂亮)。健康监控更像是一种“霰弹枪”查看/监控一切的方法,并且涉及更多的设置工作。哦,是啊,需要改变吗?它是开源的,抓住它,随心所欲地改变它。

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.

强者自强 2024-08-29 07:24:01

我没有在 ASP.NET 中使用过健康监控,但我使用过 ELMAH,它简直太神奇了。实际上只需要 2 分钟即可完成设置,然后您就可以看到所有错误。还有很多选项可以显示错误。尝试一下 ELMAH,您一定会喜欢的。

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.

忘东忘西忘不掉你 2024-08-29 07:24:01

ASP.NET 运行状况监控将自动生成应用程序域启动和关闭、心跳等事件的消息以及有关 Web 应用程序的许多其他信息。日志记录框架不支持此类功能,但您可以将运行状况监控系统事件路由到您选择的日志记录框架。有些框架甚至开箱即用地支持这一点,例如 CuttingEdge.Logging。以下是 CuttingEdge.Logging 的配置示例,其中运行状况事件被转发到日志记录提供程序:

<?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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文