Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
The Basic, Standard, and Enterprise plans will be deprecated starting from mid-March, 2025, with a 3 year retirement period. We recommend transitioning to Azure Container Apps. For more information, see the Azure Spring Apps retirement announcement.
The Standard consumption and dedicated plan will be deprecated starting September 30, 2024, with a complete shutdown after six months. We recommend transitioning to Azure Container Apps. For more information, see Migrate Azure Spring Apps Standard consumption and dedicated plan to Azure Container Apps.
This article applies to: ✅ Java ✅ C#
This article applies to: ✅ Basic/Standard ✅ Enterprise
This article shows you how to use the diagnostics functionality of Azure Spring Apps to analyze logs with Elastic (ELK).
The following video introduces unified observability for Spring Boot applications using Elastic.
To configure diagnostics settings, use the following steps:
Note
There might be a gap of up to 15 minutes between when logs are emitted and when they appear in your Elastic deployment. If the Azure Spring Apps instance is deleted or moved, the operation won't cascade to the diagnostics settings resources. You have to manually delete the diagnostics settings resources before you perform the operation against its parent, the Azure Spring Apps instance. Otherwise, if you provision a new Azure Spring Apps instance with the same resource ID as the deleted one, or if you move the Azure Spring Apps instance back, the previous diagnostics settings resources will continue to extend it.
To learn more about deploying Elastic on Azure, see How to deploy and manage Elastic on Microsoft Azure.
Use the following steps to analyze the logs:
From the Elastic deployment overview page in the Azure portal, open Kibana.
In Kibana, in the Search bar at top, type Spring Cloud type:dashboard.
Select [Logs Azure] Azure Spring Apps logs Overview from the results.
Search on out-of-the-box Azure Spring Apps dashboards by using the queries such as the following:
azure.springcloudlogs.properties.app_name : "visits-service"
Application logs provide critical information and verbose logs about your application's health, performance, and more. Use the following steps to analyze the logs:
In Kibana, in the Search bar at top, type Discover, then select the result.
In the Discover app, select the logs- index pattern if it's not already selected.
Use queries such as the ones in the following sections to help you understand your application's current and past states.
For more information about different queries, see Guide to Kibana Query Language.
To review a list of application logs from Azure Spring Apps, sorted by time with the most recent logs shown first, run the following query in the Search box:
azure_log_forwarder.resource_type : "Microsoft.AppPlatform/Spring"
To review a list of application logs from Azure Spring Apps, sorted by time with the most recent logs shown first, run the following query in the Search box:
azure.springcloudlogs.category : "ApplicationConsole"
To review unsorted log entries that mention an error or exception, run the following query:
azure_log_forwarder.resource_type : "Microsoft.AppPlatform/Spring" and (log.level : "ERROR" or log.level : "EXCEPTION")
The Kibana Query Language helps you form queries by providing autocomplete and suggestions to help you gain insights from the logs. Use your query to find errors, or modify the query terms to find specific error codes or exceptions.
To review log entries that are generated by a specific service, run the following query:
azure.springcloudlogs.properties.service_name : "sa-petclinic-service"
To review logs from Config Server, run the following query:
azure.springcloudlogs.properties.type : "ConfigServer" and (log.level : "ERROR" or log.level : "WARN")
To review logs from Service Registry, run the following query:
azure.springcloudlogs.properties.type : "ServiceRegistry"
Kibana allows you to visualize data with Dashboards and a rich ecosystem of visualizations. For more information, see Dashboard and Visualization.
Use the following steps to show the various log levels in your logs so you can assess the overall health of the services.
From the available fields list on left in Discover, search for log.level in the search box under the logs- index pattern.
Select the log.level field. From the floating informational panel about log.level, select Visualize.
From here, you can choose to add more data from the left pane, or choose from multiple suggestions how you would like to visualize your data.
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Capture Web Application Logs with App Service Diagnostics Logging - Training
Learn about how to capture trace output from your Azure web apps. View a live log stream and download logs files for offline analysis.
Certification
Microsoft Certified: Azure Cosmos DB Developer Specialty - Certifications
Write efficient queries, create indexing policies, manage, and provision resources in the SQL API and SDK with Microsoft Azure Cosmos DB.