You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/spring-cloud/spring-cloud-howto-log-streaming.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Azure Spring Cloud log streaming for instant availability
2
+
title: Stream Azure Spring Cloud app logs in real-time
3
3
description: How to use log streaming to view application logs instantly
4
4
author: MikeDodaro
5
5
ms.author: barbkess
@@ -8,14 +8,13 @@ ms.topic: how-to
8
8
ms.date: 01/14/2019
9
9
---
10
10
11
-
# Azure Spring Cloud log streaming for instant availability
12
-
13
-
The log streaming feature makes application logs available instantly using CLI with limited range. To view logs out of range, see [Analyze logs and metrics with diagnostics settings](./diagnostic-services.md).
11
+
# Stream Azure Spring Cloud app logs in real-time
12
+
Azure Spring Cloud enables log streaming in Azure CLI to get real-time application console logs for troubleshooting. You can also [Analyze logs and metrics with diagnostics settings](./diagnostic-services.md).
14
13
15
14
## Prerequisites
16
15
17
-
* Install minimum version 0.2.0 of the [Azure CLI extension](https://docs.microsoft.com/azure/spring-cloud/spring-cloud-quickstart-launch-app-cli#install-the-azure-cli-extension)
18
-
* An instance of **Azure Spring Cloud** with a running application, for example [Spring Cloud app](./spring-cloud-quickstart-launch-app-cli.md)
16
+
* Install [Azure CLI extension](https://docs.microsoft.com/azure/spring-cloud/spring-cloud-quickstart-launch-app-cli#install-the-azure-cli-extension) for Spring Cloud, minimum version 0.2.0 .
17
+
* An instance of **Azure Spring Cloud** with a running application, for example [Spring Cloud app](./spring-cloud-quickstart-launch-app-cli.md).
19
18
20
19
## Use CLI to tail logs
21
20
@@ -27,9 +26,9 @@ az configure --defaults spring-cloud=<service instance name>
27
26
In following examples, the resource group and service name will be omitted in the commands.
28
27
29
28
### Tail log for app with single instance
30
-
If an app named auth-service has only one instance, you can view the instance log with following command:
29
+
If an app named auth-service has only one instance, you can view the log of the app instance with the following command:
31
30
```
32
-
az spring-cloud app log tail -n auth-service
31
+
az spring-cloud app log tail -n auth-service
33
32
```
34
33
This will return logs:
35
34
```
@@ -43,22 +42,23 @@ This will return logs:
43
42
```
44
43
45
44
### Tail log for app with multiple instances
46
-
If multiple instances exist for the app named `auth-service`, you can view the instance log by using the `-i/--instance` option. If the service auth-service has an instance named with auth-service-default-12-75cc4577fc-pw7hb, you can query with the following command.
45
+
If multiple instances exist for the app named `auth-service`, you can view the instance log by using the `-i/--instance` option. For example, you can stream the log of an instance of one app by specifying the app name and instance name:
46
+
47
47
```
48
-
az spring-cloud app log tail -n auth-service -i auth-service-default-12-75cc4577fc-pw7hb
48
+
az spring-cloud app log tail -n auth-service -i auth-service-default-12-75cc4577fc-pw7hb
49
49
```
50
50
You can also get the app instances from the Azure portal.
51
51
1. Navigate to your resource group and select your Azure Spring Cloud instance.
52
52
1. From the Azure Spring Cloud instance overview select **Apps** in the left navigation pane.
53
53
1. Select your app, and then click **App Instances** in the left navigation pane.
54
54
1. App instances will be displayed.
55
55
56
-
### Follow option to track new logs
57
-
By default, CLI will only print the existing log to console without following new logs. If you need to track the new logs, use `-f(--follow)` to track the new logs:
56
+
### Continuously stream new logs
57
+
By default, `az spring-cloud ap log tail` prints only existing logs streamed to the app console and then exits. If you want to stream new logs, add -f (--follow):
0 commit comments