Azure functions logs taking 5 minutes or longer to show up

Juan Pablo Olguin 21 Reputation points
2021-10-26T15:24:32.217+00:00

Hello everyone,

We are developing a fairly complex Function app composed of several functions that's running but every time some of the functions logs some error, the error log for that function in order to show in monitoring is taking 5 minutes to appear, and sometimes even longer. This is causing the feedback loop too long and slowing us down noticeably.

Each successful whole execution of the function only takes 300-500 ms on average. We are on development phase so the whole instance is under no stress, not even high load and yet we cannot see the error log until several minutes have passed. We are not sure but if you print the content of some variable it seems to take longer (if you use logging.info method instead of logging.error).

I have seen some answers on stackoverflow mentioning you can send the logs to other service like a DB, or I was thinking, to some azure storage container but we will be dealing with many different tenants and azure storage containers so I don't want to complicate things like this.

Is there any way to make the functions error log appear on each function's monitoring log right away or at least with a few seconds of delays?

Thank you

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

Accepted answer
  1. MughundhanRaveendran-MSFT 12,481 Reputation points
    2021-10-26T16:27:28.203+00:00

    @Juan Pablo Olguin ,

    Thanks for reaching out to Q&A.

    As you mentioned, for the logs/function invocations to appear in the monitor section may be delayed for upto 5 minutes. This is an expected behavior and it is mentioned in the portal

    143866-image.png

    If you are looking for the logs to appear instantaneously , you can switch to logs tab in the same monitor section which displays the log streaming service.

    143855-image.png

    I would also suggest you to look into the Live metrics of the Function app's Application insights which will show the logs right away.

    • Navigate to Application insights in the Function app and click on it.
    • Select the Live metrics and you will see the request, response, invocations , trace etc. The sample telemetry in the live metrics will be very helpful for your scenario

    143856-image.png

    Feel free to reach out to me if you have any queries.

    I hope this helps!

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful

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.