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
+19-6Lines changed: 19 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,16 +42,29 @@ This will return logs:
42
42
```
43
43
44
44
### Tail log for app with multiple instances
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:
45
+
If multiple instances exist for the app named `auth-service`, you can view the instance log by using the `-i/--instance` option.
46
+
47
+
First, you can get the app instance names with following command.
48
+
49
+
```
50
+
az spring-cloud app show -n auth-service --query properties.activeDeployment.properties.instances -o table
auth-service-default-12-75cc4577fc-pw7hb Running UP
58
+
auth-service-default-12-75cc4577fc-8nt4m Running UP
59
+
auth-service-default-12-75cc4577fc-n25mh Running UP
60
+
```
61
+
Then, you can stream logs of an app instance with the option `-i/--instance` option:
46
62
47
63
```
48
64
az spring-cloud app log tail -n auth-service -i auth-service-default-12-75cc4577fc-pw7hb
49
65
```
50
-
You can also get the app instances from the Azure portal.
51
-
1. Navigate to your resource group and select your Azure Spring Cloud instance.
52
-
1. From the Azure Spring Cloud instance overview select **Apps** in the left navigation pane.
53
-
1. Select your app, and then click **App Instances** in the left navigation pane.
54
-
1. App instances will be displayed.
66
+
67
+
You can also get details of app instances from the Azure portal. After selecting **Apps** in the left navigation pane of your Azure Spring Cloud service, select **App Instances**.
55
68
56
69
### Continuously stream new logs
57
70
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