Missing logs in azure monitor

2024-03-22T11:07:06.28+00:00

Hello!
Is there a reason for missing logs in a function app? for some requests the logs are visible, but sometimes they are not shown so I'm wondering what could affect the function logging so that no results are shown. Screenshot 2024-03-22 at 11.40.06

Not are functions are affected but one service bus trigger that is quite heavily loaded and receives requests night time

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
2,803 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,265 questions
0 comments No comments
{count} votes

Accepted answer
  1. Deepanshu katara 4,825 Reputation points
    2024-03-22T18:24:59.4+00:00

    Hi,

    Thanks for reaching out & posting on MS Q&A. We'd be happy to assist you here and help make your Azure experience a great one!

    The reason for the absence of the log messages is probably due to the Test/Run feature not mimicking an actual creation of a blob file that would cause (a) the invoking of your trigger function and (b) capturing of the log messages that you'd then expect to see via the log streaming window. For a quick validation of this behavior, you can spin up an HTTP trigger function and try the Test/Run feature to see if the logs from it show.

    For testing the Blob trigger & getting the log messages in the log streaming window, you'll need to actually upload a blob file as detailed in our documentation here: https://learn.microsoft.com/en-us/azure/azure-functions/functions-create-storage-blob-triggered-function#test-the-function

    I hope this helps. Please let me know if you have any further questions.


    Please consider contributing to MS Q&A by marking 'Accepted Answer' and ‘Upvoting’ as applicable.


1 additional answer

Sort by: Most helpful
  1. Deepanshu katara 4,825 Reputation points
    2024-03-28T09:37:20.6333333+00:00

    Hi Zainab,

    Issue -->logs were missing from Azure monitor

    Solution--> Adding this to sampling Settings in host.json file resolved the issue

    "samplingSettings": {
            "isEnabled": true,
            "excludedTypes": "Request;Trace"
          }
    
    

    For more details, please check this doc https://learn.microsoft.com/en-us/azure/virtual-wan/how-to-virtual-hub-routing

    Please remember to "Accept Answer" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.

    Thanks,

    Deepanshu

    0 comments No comments