@Anuj Pachawadkar Welcome to Microsoft Q&A Forum, Thank you for posting your query here!
I understand that you are facing an issue with Azure Function Apps, where you are unable to see logs in the monitor section when testing or running functions with NodeJS and Python runtimes. The monitor only shows the message Results may be delayed for up to 5 minutes.
There are multiple ways you can view the Azure Function logs. Please see the below suggestions, you can follow any of the below suggestions, whichever is feasible to you.
Using Kudu Console:
The Function logs are written to the log files. You can access these logs from the Kudu console from Azure FunctionApp portal as shown below:
**
Using Logger and also loglevel:**
Ensure that you have configured the logger as mentioned in this document.
Also the logLevel is defined in the host.json. So please check within your host.json file which logLevel has been defined.
"logging": {
"fileLoggingMode": "always",
"logLevel": {
"default": "Information",
"Host.Results": "Error",
"Function": "Trace",
"Host.Aggregator": "Trace"
}
}
Using Visual Studio Code and the Azure Functions Extension
From your VS Code, using the Azure Functions Extension) you can try to connect to the log stream of your azure function as shown below:
Using func core tools:
You can use the func azure functionapp logstream command to view the streaming logs of a specific function app running in Azure, as in the following example:
func azure functionapp logstream <FunctionAppName>
Using Azure CLI:
You can enable streaming logs by using Azure PowerShell. For PowerShell, use the Set-AzWebApp command to enable logging on the function app, as shown in the following snippet:
Set-AzWebApp -RequestTracingEnabled $True -HttpLoggingEnabled $True -DetailedErrorLoggingEnabled $True -ResourceGroupName $ResourceGroupName -Name $AppName
Using Application Insights
Please refer to the application insights log of your function app and verify if there is any configuration issue i.e. the storage connection string is not added/configured correctly in your application setting of your function app?
Sharing some of the threads where similar issues were reported:
https://stackoverflow.com/questions/44657584/azure-function-apps-logs-not-showing
Hope this helps.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.