Home > Software engineering >  How do I disable Application Insights logging in Microsoft.ApplicationInsights.AspNetCore" Vers
How do I disable Application Insights logging in Microsoft.ApplicationInsights.AspNetCore" Vers

Time:06-29

I have an Asp.Net Core 6 Web Api.

I added Application Insights to it and I have stored the Connection string in a local Secrets.json file as is recommended.

I don't want to send telemetry when in debug while I am still developing the app.

I want to be able to switch it on and off while I develop.

What is the best way to do it?

The first thing that comes to my mind is to adjust the log level in appsettings.Development.json:

"ApplicationInsights": {
      "LogLevel": {
        "Default": "None"
      }
    }

I see this question enter image description here

  • Related