Microsoft Certified: DevOps Engineer ExpertImplement an instrumentation strategyMedium
A development team is deploying a new web application to Azure App Service. They need to ensure that all application logs, including custom diagnostic messages and structured data, are collected and stored in a centralized location for long-term analysis and compliance. The solution must allow for complex queries and integration with other monitoring tools. Which logging strategy should they implement?
- AEnable built-in App Service file system logging.
- BConfigure App Service diagnostics to send logs to Azure Monitor Log Analytics workspace.
- CUse Azure Event Hubs to stream logs to a custom endpoint.
- DDirectly write logs to Azure Blob Storage.
Show answer & explanationAnswer & explanation
Correct answer: B. Configure App Service diagnostics to send logs to Azure Monitor Log Analytics workspace.
Sending App Service diagnostics logs to an Azure Monitor Log Analytics workspace provides a centralized, scalable solution for storing and querying logs. It supports structured data, complex Kusto Query Language (KQL) queries, and integrates well with other Azure monitoring services.
Why the other options are wrong
- A. File system logging is temporary, not centralized, and not suitable for long-term analysis or compliance requirements.
- C. Event Hubs is a streaming service; it needs a consumer (like Log Analytics) to store and analyze the data effectively.
- D. Blob Storage is good for archival but lacks native querying capabilities and integration for log analysis.
Azure Monitor Log Analytics
A service within Azure Monitor that collects and analyzes telemetry data from various sources, enabling powerful querying and visualization.
- Centralized repository for logs and metrics.
- Uses Kusto Query Language (KQL) for data exploration.
- Integrates with other Azure services for comprehensive monitoring.
Memory trick: Log Analytics is the hub for all your log data.