asp.net - ASP.NET 4.8 Web 应用程序中的应用程序洞察配置

标签 asp.net azure logging web-applications azure-application-insights

我们如何在入口点为 global.asax.cs 的 asp.net 4.8 Web 应用程序中配置应用程序见解 我需要在单独的项目中提取日志记录,并使用 Logger 因子 <强>Microsoft.Extensions.Logging

最佳答案

我希望您已经创建了一个 4.8 Web 应用程序。按照解决方法在 Web 应用程序项目中添加 Application Insights。

解决方法如下:

使用 NuGet 包管理器在应用程序中安装 Application Insights 包 Microsoft.ApplicationInsights

enter image description here

在 Web 应用程序中配置应用程序洞察:

右键单击您的项目,然后单击配置 Application Insights

enter image description here

它会要求您选择配置 Application Insights本地Azure。根据您的要求选择。

enter image description here

它将把您的 Web 应用程序配置到 Application Insights 中。它添加了 ApplicationInsights.config 文件,其中包含 Application Insights 的配置。

enter image description here

配置完成后我们可以在Application Insights中看到遥测数据

结果

enter image description here

引用文献:

  1. Using pageview to collect telemetry data in pages在 web.config 中使用添加 Instrumentation key
  2. Using Application Insights in global.aspx

关于asp.net - ASP.NET 4.8 Web 应用程序中的应用程序洞察配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73345475/

相关文章:

Java 日志文件创建多个副本

html - asp文本框水印颜色

c# - 在 aspx 中显示代码隐藏

asp.net - 何时使用共享变量

azure - Xamarin.Mac Azure 通知中心

使用 Powershell 中的资源管理器 Azure 发布 Web 应用程序

asp.net - 编辑后如何从数据库刷新 ASPxGridView

c# - 如何将 Microsoft.Azure.Devices.Client.DeviceClient KeepAliveInSeconds 设置为大于 30 的数字

azure - 如何获取Windows Azure Portal中的用户日志?

java - 未找到 WildFly 9.0.1 WFLYCTL0158 处理程序 "CONSOLE"