如何在不重新部署的情况下更改 Azure 应用服务的 TraceLevel?

How can I change the TraceLevel for an Azure App Service without redeploying it?

我在部署到 Azure 应用服务(以前称为 "Azure Web Site")的 MVC 5 应用程序中使用 Application Insights。我将 Application Insights 设置为跟踪侦听器。一切正常 - 我正在使用 .

我的下一个需求是能够在不重新部署站点的情况下控制 TraceLevel 设置。我很可能会全天候 (24/7) 将其保持在 Warning,但如果发生有趣或有趣的事情,我想将其降低到信息或详细。我要问的正是这种特定的设置更改。所以我的问题:

  1. 是否有内置方法 change/toggle 无需任何停机或部署?
  2. 无论上一个问题的答案是什么,是否有最佳实践方法来完成此任务?真的想避免 hiccups/downtime 当我切换它时,虽然如果我必须遭受打嗝那么这仍然比重新部署更好。

注意:我正在用 Application Insights 标记它,但我认为我的跟踪侦听器是什么并不重要。

根据此页面:

https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-enable-diagnostic-log

Unlike changing the web.config file, enabling Application diagnostics or changing diagnostic log levels does not recycle the app domain that the application runs within.