azure-spring-cloud-training/03-configure-monitoring
..
media
README.md

README.md

03 - Configure application logs

This guide is part of the Azure Spring Apps training

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.


Configure log aggregation

There are actually 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.

Having completed the setup in Section 00, you should have a Log Analytics workspace named sclab-la-<unique string> in your resource group for this workshop. We must now configure our Azure Spring Apps instance to send its data to this workspace.

  • Navigate to the Azure Spring Apps instance in Azure Portal and select "Diagnostic settings" in the "Monitoring" section of the navigation pane:

Diagnostic Settings

  • Click on "Add diagnostic setting" and configure your instance to send all its logs to the Log analytics workspace that we just created.
  • Fill in the values as shown here and click "Save".

Send logs to the log analytics workspace

⬅️ Previous guide: 02 - Build a simple Spring Boot microservice

➡️ Next guide: 04 - Configure a Spring Cloud Config server