简体   繁体   中英

Application insights configuration in asp.net 4.8 web application

how can we configure application insights in asp.net 4.8 web application which has the entry point as global.asax.cs I need to pull out the logging in separate project and use Logger factor with Microsoft.Extensions.Logging

I hope you already created a 4.8 Web Application . Follow the workaround to add Application Insights in your Web Application Project.

Workaround follows:

Install the Application Insights Package Microsoft.ApplicationInsights in your application using NuGet Package Manager.

在此处输入图像描述

Configure Application insights in your Web Applicaiton:

Right click of your project and click Configure Application Insights

在此处输入图像描述

It will ask you to choose Configure Application Insights either local or Azure . Choose as per your requirement.

在此处输入图像描述

It will configure your Web App into Application Insights. It adds the ApplicationInsights.config file which contains the configuration of Application Insights.

在此处输入图像描述

After the configuration done we can see the telemetry data in Application Insights

Results

在此处输入图像描述

References:

  1. Using pageview to collect telemetry data in pages using Adding Instrumentation key in web.config
  2. Using Application Insights in global.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM