Now that we have an application deployed, we'll configure Log Analytics, so that we can quickly search the application's logs if something goes wrong. We'll see how to take advantage of Log Analytics in a later section, but because it takes time for log entries to start coming in, we'll do the configuration steps here before moving on with the training.
There are three ways to access your application's logs: Azure Storage, Azure Events Hub, and Log Analytics. We will focus here on Log Analytics as it's the most common one, and as it's integrated into Azure Spring Apps.
Log Analytics is part of Azure Monitor, which is well-integrated into Azure Spring Apps and which we will also use for metrics monitoring.
💡 Note: You should have a Log Analytics workspace pre-created named sclab-la- in your resource group for this workshop.
-
Navigate to the Azure Spring Apps instance named azure-spring-apps-lab- in Azure Portal and select "Diagnostic settings" in the "Monitoring" section of the navigation pane:
-
Click on + Add diagnostic setting and configure your instance to send all its logs to the Log Analytics workspace that we just created.
-
Under the Diagnostic Settings page, follow the below mentioned steps:
- Name: write-to-log-analytics (1)
- Under Logs, check the boxes next to ApplicationConsole and SystemLogs (2)
- Under Metrics, check the box next to AllMetrics (3)
- Under Destination details, check the box next to Send to Log Analytics workspace (4)
- Click Save (5).