我可以在 ii7 中为经典 asp 配置 healthMonitoring 吗?

发布于 2024-07-18 08:48:45 字数 389 浏览 6 评论 0原文

我发现为了在 ii7 中显示经典 asp 的错误,我必须使用 web.config 和 asp.net 的配置,如下所示:

<system.webServer>
                <httpErrors errorMode="Detailed" />
                <asp scriptErrorSentToBrowser="true" />
            </system.webServer>

但是:

我可以在经典 asp 中使用 healthMonitoring 来获取有关经典 asp 中错误的电子邮件错误吗?

尝试过无法收到任何电子邮件:( 只需重定向到主页

I see that for showing error of classic asp in ii7 i must use web.config with configurations for asp.net like this:

<system.webServer>
                <httpErrors errorMode="Detailed" />
                <asp scriptErrorSentToBrowser="true" />
            </system.webServer>

BUT:

may i use healthMonitoring in classic asp for getting email errors about bugs in classic asp?

tried it by cant get any emails :( simply do redirect to homepage

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

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

发布评论

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

评论(1

双马尾 2024-07-25 08:48:45

据我所知,您无法对“经典”ASP 站点使用 ASP.NET 运行状况监控。

此页面,MSDN 网站上的 asp 元素 - IIS 7 设置架构详细介绍了 节点内 节点的所有不同属性,不幸的是,似乎没有切换机制关于健康监测。

这是有道理的,因为 节点由 IIS7 本身而不是 ASP.NET 运行时处理并定义配置,而运行状况监控功能是 ASP.NET 特定的,并且它甚至由 .NET 框架的 System.Web 中的类实现。管理命名空间

也就是说,如果您希望在经典 ASP 应用程序中发生错误时通过电子邮件收到警报,您可以通过设置 errorsToNTLog 属性来实现此目的。 节点设置为 True

<system.webServer>
  <httpErrors errorMode="Detailed" />
  <asp scriptErrorSentToBrowser="true" errorsToNTLog="True" />
</system.webServer>

这将确保应用程序中发生的 ASP 错误将记录到 Windows 事件日志中。 然后,您可以使用单独的实用程序监视这些错误,该实用程序会在写入事件日志条目时向您发送电子邮件通知。

有关如何实现这一点的详细说明,以及执行此操作所需的各种工具选项(开源、商业甚至自定义 VBScript),可以在此 ServerFault 帖子中找到:

Windows 事件日志 - 电子邮件通知

As far as I know, you cannot use the ASP.NET Health Monitoring for "classic" ASP sites.

This page, asp Element - IIS 7 Settings Schema on the MSDN website details all of the different attributes to the <asp> node within the <system.webServer> node, and unfortunately, there does not seem to be a mechanism for switching on health monitoring.

This makes sense as the <system.webServer> node is processed by, and defines configuration for IIS7 itself rather than the ASP.NET runtime, whereas the Health Monitoring functionality is ASP.NET specific, and it is even implemented by classes within the .NET framework's System.Web.Management Namespace.

That said, if you're looking to be alerted, via email, whenever an error occurs within your classic ASP application, you could achieve this by setting the errorsToNTLog attribute of the <asp> node to True:

<system.webServer>
  <httpErrors errorMode="Detailed" />
  <asp scriptErrorSentToBrowser="true" errorsToNTLog="True" />
</system.webServer>

This will ensure that ASP errors occurring within your application will be logged to the Windows Event Log. You can then monitor these errors using a separate utility which will fire off an email notification to you when an event log entry is written.

A detailed explanation of how this can be achieved, and the various options for tools (open-source, commercial or even a custom VBScript) needed to perform this, can be found within this ServerFault posting:

Windows Event Log - email notification

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