0
votes

I have an Azure Function app for which I'm using Application Insights with ILogger for trace and exception logging.

Where I catch an exception then it's logged using the ILogger.LogError method passing the caught exception object as the second parameter (ms docs description)

This works well and the exception details including stack trace are logged. My problem is displaying this detail in a way that's easy to read. I can run the following kusto query in the Azure portal but the results are presented in a small table.

exceptions
| limit 10
| sort by timestamp desc 
| project timestamp, details,  outerMessage, innermostMessage

Is there a quick way to get a better view of the exception data? I tried "pin to dashboard" but received a message "Don't have permissions to create a new dashboard for this resource group." - even though it was me that created the selected resource group.

2
which query are you using? and also provide the screenshot of the query result. - Ivan Yang
Do you want the log.LogDebug to be printed in the console ? - HariHaran

2 Answers

0
votes

Have you looked for the exception in the Search page of the portal instead of Analytics? https://docs.microsoft.com/en-us/azure/azure-monitor/app/diagnostic-search https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-exceptions

It shows Exception stack etc. You can do filtering of the telemetry, and then jump to analytics from the search page where the kusto query used by the search page will be populated for you.

0
votes

Thanks to @cijothomas - need to check the "Event types" option

enter image description here