简体   繁体   English

如何通过Azure门户更改Azure功能的日志记录详细程度?

[英]How to change logging verbosity for an Azure Function via Azure portal?

All the doco I've found shows how to set the logging verbosity of an Azure function via the hosts.json file with the config below. 我发现的所有文档都显示了如何通过使用以下配置的hosts.json文件设置Azure函数的日志记录详细程度。

I would like to change the logging verbosity without having to redeploy this file. 我想更改日志记录的详细程度,而不必重新部署此文件。

However, I can't see any samples where the verbosity is being set via the portal. 但是,我看不到通过门户设置详细程度的任何示例。 I've tried using portal Application Settings with the App Setting Name logging:logLevel.default but that has no affect. 我尝试将门户网站应用程序设置与应用程序设置名称logging:logLevel.default一起使用,但这没有任何效果。

Does anyone know if this can be done? 有谁知道这可以做到吗?

{
  "version": "2.0",
  "logging": {
    "fileLoggingMode": "debugOnly",
    "logLevel": {
      // For all functions
      "Function": "Trace",
      // Default settings, e.g. for host
      "default": "Trace"
    }
  }
}

Please note I'm running from a package file which is the recommended approach. 请注意,我从推荐的软件包文件中运行。

You can also set these settings in host.json file without re-deploy. 您也可以在host.json文件中设置这些设置,而无需重新部署。 There is a host.json setting on the azure portal as well. 在Azure门户上也有一个host.json设置。

Please go to your function app -> Overview -> Function app settings, then you can see there is a host.json, you can set log level there, then save and no need to re-deploy(And remember to change the edit mode of your function app as Read/Write as described in screenshot below). 请转到您的功能应用程序->概述->功能应用程序设置,然后您可以看到其中有一个host.json,可以在其中设置日志级别,然后保存并且无需重新部署(记住要更改编辑模式如下面的屏幕截图所示,将功能应用程序设置为“读/写”。

在此处输入图片说明

remember to change the edit mode of your function app as Read/Write 切记将功能应用程序的编辑模式更改为“读/写”

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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