Disable logging of host lock lease renew calls in Azure Function

Viewed 417

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.

1 Answers

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

Related