I have Azure Functions and try to see log of this function on Portal (select concrete function -> Monitor -> select a call of function). But often I see "No results":
And I don’t understand when I will see data and when I will see "No result". Seems, it’s randomly
Why so and how to see this data?
I have tried to reproduce the issue from my end by creating a Function App and a Http Triggered Function inside the Function App.
I have run this function multiples times to generate the logs and I can see the logs from the monitor section of my Function app as shown below in the Screenshots:
Next, I have made some changes in the function code to throw some errors and then Run the function to see the error logs and those were also logged successfully as shown below:
You can also check logs in Kudu console,
goto–>FunctionApp–>Advanced Tools–>then click on Go.
You can see the Kudu console and there you can see the logs here:
Workaround:
You can try to clear the Browser’s cache and try again to check the logs of your Function in the Function App.
Thanks to @MughundhanRaveendran-MSFT, as suggested here,try disable sampling in Application insights or exclude request and exception in the sampling section under the Host.json file.
As per my understanding, there were no proper log statements for failing cases, which is why you are not getting any when the function gets an error.
Also, it usually takes time sometimes, to load the logs in the Azure portal.
2
Answers
I have tried to reproduce the issue from my end by creating a Function App and a Http Triggered Function inside the Function App.
I have run this function multiples times to generate the logs and I can see the logs from the monitor section of my Function app as shown below in the Screenshots:
Next, I have made some changes in the function code to throw some errors and then Run the function to see the error logs and those were also logged successfully as shown below:
You can also check logs in Kudu console,
goto–>
FunctionApp
–>Advanced Tools
–>then click onGo
.You can see the Kudu console and there you can see the logs here:
Workaround:
You can try to clear the Browser’s cache and try again to check the logs of your Function in the Function App.
Thanks to @MughundhanRaveendran-MSFT, as suggested here,try disable sampling in Application insights or exclude request and exception in the sampling section under the
Host.json
file.As per my understanding, there were no proper log statements for failing cases, which is why you are not getting any when the function gets an error.
Also, it usually takes time sometimes, to load the logs in the Azure portal.