Search code examples
azure-application-insights

Changing Application Insights Logging Level at Runtime on Azure App Service


I have deployed an application as a Microsoft Azure Web App with a log level Default of Information as shown below in appsettings.json in code. Is it possible to change the log level for example to Trace during runtime without redeploying?

"ApplicationInsights": { "LogLevel": { "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" }


Solution

  • How about using kudu?

    First, we all know that we can change the log level by modify the configuration in appsetting.json, hence we can using kudu to change the value after deploying to azure web app. Pls note the setting in my screenshot below, it's Logging->appinsights->loglevel

    After deploying to azure web app, you can visit https://yourdomain.scm.azurewebsites.net to reach kudu website, in this website, you can modify all the settings in static files. I've tested in my side and it worked well.

    enter image description here enter image description here