我们如何在入口点为 global.asax.cs 的 asp.net 4.8 Web 应用程序中配置应用程序见解 我需要在单独的项目中提取日志记录,并使用 Logger 因子 <强>Microsoft.Extensions.Logging
最佳答案
我希望您已经创建了一个 4.8 Web 应用程序。按照解决方法在 Web 应用程序项目中添加 Application Insights。
解决方法如下:
使用 NuGet 包管理器在应用程序中安装 Application Insights 包 Microsoft.ApplicationInsights。
在 Web 应用程序中配置应用程序洞察:
右键单击您的项目,然后单击配置 Application Insights
它会要求您选择配置 Application Insights本地或Azure。根据您的要求选择。
它将把您的 Web 应用程序配置到 Application Insights 中。它添加了 ApplicationInsights.config 文件,其中包含 Application Insights 的配置。
配置完成后我们可以在Application Insights中看到遥测数据
结果
引用文献:
- Using pageview to collect telemetry data in pages在 web.config 中使用添加 Instrumentation key
- Using Application Insights in global.aspx
关于asp.net - ASP.NET 4.8 Web 应用程序中的应用程序洞察配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73345475/