Multiple innovacation logs in function App

Jomon John 0 Reputation points
2025-02-24T07:06:33.03+00:00

Multiple innovacation logs in function App . Below is the host.json file

{

"version": "2.0",

"logging": {

"applicationInsights": {

  "samplingSettings": {

    "isEnabled": true,

    "excludedTypes": "Request"

  }

},

"logLevel": {

  "default": "Information",

  "Host.Aggregator": "Trace",

  "Host.Results": "Error",

  "Function": "Information"

}

},

"extensions": {

"queues": {

  "messageEncoding": "none"

}

}

}

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,526 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Alex Burlachenko 1,750 Reputation points
    2025-02-24T07:22:33.9666667+00:00

    Hi Jomon,

    It looks like you're dealing with multiple invocation logs in your Azure Function App. Your host.json configuration seems mostly fine

    Adjust Log Levels, u can fine-tune the log levels to reduce noise. For example, setting Function Warning instead of Information might help.

    Sampling Settings u Application Insights sampling is enabled, which is good for reducing volume. Ensure it's configured to sample the right types of telemetry. Custom Logging implement custom logging within your functions to log only what's necessary. Review Host Settings, ensure that Host.Aggregator and Host.Results are set appropriately for your needs.

    If the logs are still overwhelming, consider filtering them in Application Insights or using query-based logging to focus on specific events.

    Hope this helps!

    rgds,

    Alex

    0 comments No comments

  2. Pravallika Kothaveeranna Gari 160 Reputation points Microsoft External Staff
    2025-03-10T12:34:07.58+00:00

    Hello Jomon John,

    Thanks for using Q & A forum.

    Solution:

    You are seeing multiple invocation logs because the default log level is set to Information which basically logs the complete general flow of the application.

    • To reduce the invocation logs, you need to fine-tune the loglevels in host.json.
    • For example, you can set default to Warning if you want to prevent excessive logging of the function.
    • Set Host.Aggregator and Host.Results to lower logging levels to avoid the loss of metrics and performance related data.

    I have modified your host.json as below and able to avoid excessive invocation logs, refer MSDOC to configure log levels for Azure functions.

    host.json:

    
    {
    
      "version": "2.0",
    
      "logging": {
    
        "applicationInsights": {
    
          "samplingSettings": {
    
            "isEnabled": true,
    
            "excludedTypes": "Request"
    
          },
    
          "logLevel": {
    
            "default": "Warning",
    
            "Host.Aggregator": "Trace",
    
            "Host.Results": "Information",
    
            "Function": "Information"
    
          }
    
        }
    
      },
    
      "extensions": {
    
        "queues": {
    
          "messageEncoding": "none"
    
        }
    
      }
    
    }
    
    

    Console output:

    enter image description here

    Hope this helps.

    If the Answer is helpful, please click Accept Answer and Up-Vote, so that it can help others in the community looking for help on similar topics.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.