Home > database >  What would be the best-practice for Azure Functions custom logging?
What would be the best-practice for Azure Functions custom logging?

Time:05-08

I have an Azure Function and I want to log custom messages, like log("16% completed");.

I tried it with application insights but couldn't find how to create a separate category for my custom logs, so I would be able to filter them, drill down into them for diagnostics and debug and etc.

From what I've read, there's also Log Analytics, but it seems now that and Application Insights are combined.

So, if I wanted my Azure Function to log custom messages, that I would use to monitor execution, be able to use them for debugging/troubleshooting and statistics, what would be the best-practice?

CodePudding user response:

You're correct. The best practice is using Application Insights / Log Analytics. You can either set them as custom properties or using another dimension such as customEvents or dependency.

https://docs.microsoft.com/en-us/azure/azure-monitor/app/api-custom-events-metrics#custom-events-in-analytics

  • Related