3

Every 5 seconds my Azure Function is logging the http request to Azure blob storage and response to renew the host lock lease. Is there a setting in the logging section of the "host.json" file that will turn these off?

These are "Information" level messages. I've tried setting the log level for "Host" to "Warning" as follows:

    {
      "version": "2.0",
      "logging": {
        "logLevel": {
          "default": "Debug",
          "Host": "Warning"
        }
      }
    }

but that doesn't seem to work.

Brian Campbell
  • 161
  • 1
  • 12

1 Answers1

0

Below are the few of workaround you can follow:

You can try to add the below cmd to your host.json in Function V2:

{
  "version": "2.0",
  "logging": {
    "logLevel": {
      "Function.MyFunctionName.User": "Information",
      "Function": "Error"
    }
  }
}

Also based on the MS DOC:

To disable built-in logging, delete the AzureWebJobsDashboard app setting. For information about how to delete app settings in the Azure portal, see the Application settings section of How to manage afunction app.

For more information please refer this: host.json reference for Azure Functions 2.x| MS DOC & SO THREAD

AjayKumarGhose
  • 4,257
  • 2
  • 4
  • 15
  • 1
    Thank you for the workaround! This does seem to work, although it means every time I add a new function I have to update the host.json file, which is unfortunate. But if there is no logLevel that specifically targets those host lock lease renewal messages, that seems to be the only fix. – Brian Campbell Dec 23 '21 at 17:07
  • @BrianCampbell Do mind that this will prevent **all** dependencies from being logged! – Peter Bons Dec 25 '21 at 09:52