how to Stop an Azure Function from logging the “Executing” and “Executed” messages

chandan jha 6 Reputation points
2021-03-15T12:46:21.413+00:00

I'm using host.json and I have configured the log level error, but still I'm seeing the trace log. Could you please guide me how to stop the trace.
{
"version": "2.0",
"logging": {
"logLevel": {
"Function.MyFunction": "Information",
"default": "Error",
"Function": "Error",
"Host.Aggregator": "Error",
"Host.Results": "Error",
"Host.Executor": "Error"
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
}
}

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,658 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. JayaC-MSFT 5,526 Reputation points
    2021-03-16T11:34:22.66+00:00

    Hello @chandan jha I have tried with this simple configuration and it works for me :

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

    Please let me know if this helps.


  2. Richard Barraclough 6 Reputation points
    2024-04-24T10:50:19.9633333+00:00

    I've tried all of these and I'm still getting spammed.

    I don't understand what to put on the left hand side of the :. Is it the namespace and class name and method name or is Function or maybe Functions a special magic word? And where did .User come from?

          "Namespace.CalculationsService.Functions.HealthFunction": "Warning",
          "Namespace.CalculationsService.Functions.HealthFunction.Health": "Warning",
          "Functions.Health": "Warning",
          "Function.Health": "Warning",
          "Health": "Warning"