This document illustrates logging design for Azure ML.
-
- Logs pattern code example
- Where to see
-
- Send logs to Azure App Insights and query with Kusto
- Create a Dashboard
| Where to log | What to log (examples) | Where from |
|---|---|---|
| Local (on demand) | Execution (console) logs during running pipeline | Python script for each step (if any) |
| Azure DevOps | - Execution (console) logs during building and publishing pipeline | Azure ML pipeline build script |
| Azure ML | - Execution (console) logs during running pipeline - Result of model performance testing |
Azure ML pipeline step scripts |
| Azure App Insights | - Additional information to identify the detail of pipeline run - Result of model performance testing - Pipeline run duration and status |
Azure ML pipeline step scripts Azure Function *1 |
*1 We cannot get run duration detail from each step, therefore we use Azure Function to query run duration and status results when each step completed/failed, which is triggered by EventGrid.
[logging.formatter]
- Default:
"%(asctime)s - %(name)s - %(levelname)s - %(message)s"
e.g. 2020-11-30 05:57:14,574 - __main__ - INFO - prune parameter: 0 2
- Azure DevOps
- Azure ML You can find logs on "Outputs + logs" pane under "Experiments" on Azure ML studio.
- Azure storage
Azure ML output log automatically store in Azure ML blob storages.
Since logs from Python wrapper are already logged in Azure ML it would be better to log only additional information to Azure App Insights. The difference from logs in Azure ML is to send only required logs by reducing the amount of info.
There is a sample demonstrates how to send logs to Azure App Insights by using Function App and query with Kusto. See pipeline monitor sample for more detail.
Dashboard is useful to centralize logs and status easily. See Azure Dashboard document for more detail.