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
This article describes how to enable log streaming in Azure CLI to get real-time application console logs for troubleshooting. You can also use diagnostics settings to analyze diagnostics data in Azure Spring Apps. For more information, see [Analyze logs and metrics with diagnostics settings](./diagnostic-services.md).
21
+
This article describes how to enable log streaming in the Azure CLI to get real-time application console logs for troubleshooting. You can also use diagnostics settings to analyze diagnostics data in Azure Spring Apps. For more information, see [Analyze logs and metrics with diagnostics settings](./diagnostic-services.md).
22
+
23
+
For streaming logs of managed components in Azure Spring Apps, see [Stream Azure Spring Apps managed component logs in real time](./how-to-managed-component-log-streaming.md).
22
24
23
25
## Prerequisites
24
26
25
-
-[Azure CLI](/cli/azure/install-azure-cli) with the Azure Spring Apps extension, minimum version 1.0.0. You can install the extension by using the following command: `az extension add --name spring`
27
+
-[Azure CLI](/cli/azure/install-azure-cli) with the Azure Spring Apps extension, version 1.0.0 or higher. You can install the extension by using the following command: `az extension add --name spring`
26
28
- An instance of Azure Spring Apps with a running application. For more information, see [Quickstart: Deploy your first application to Azure Spring Apps](./quickstart.md).
27
29
28
-
## Use Azure CLI to produce tail logs
30
+
## Use the Azure CLI to produce tail logs
29
31
30
-
This section provides examples of using Azure CLI to produce tail logs. To avoid repeatedly specifying your resource group and service instance name, use the following commands to set your default resource group name and cluster name:
32
+
This section provides examples of using the Azure CLI to produce tail logs. To avoid repeatedly specifying your resource group and service instance name, use the following commands to set your default resource group name and cluster name:
31
33
32
34
```azurecli
33
35
az config set defaults.group=<service-group-name>
@@ -44,7 +46,7 @@ If an app named `auth-service` has only one instance, you can view the log of th
44
46
az spring app logs --name <application-name>
45
47
```
46
48
47
-
This command returns logs similar to the following examples, where `auth-service` is the application name.
49
+
The command returns logs similar to the following examples, where `auth-service` is the application name.
48
50
49
51
```output
50
52
...
@@ -66,7 +68,7 @@ First, run the following command to get the app instance names:
66
68
az spring app show --name auth-service --query properties.activeDeployment.properties.instances --output table
67
69
```
68
70
69
-
This command produces results similar to the following output:
71
+
The command produces results similar to the following output:
70
72
71
73
```output
72
74
Name Status DiscoveryStatus
@@ -86,7 +88,7 @@ You can also get details of app instances from the Azure portal. After selecting
86
88
87
89
### Continuously stream new logs
88
90
89
-
By default, `az spring app logs` prints only existing logs streamed to the app console, and then exits. If you want to stream new logs, add the `-f/--follow` argument:
91
+
By default, `az spring app logs` prints only existing logs streamed to the app console and then exits. If you want to stream new logs, add the `-f/--follow` argument, as shown in the following example:
90
92
91
93
```azurecli
92
94
az spring app logs --name auth-service --follow
@@ -149,19 +151,19 @@ Azure Spring Apps also enables you to access real-time app logs from a public ne
149
151
150
152
### [Azure portal](#tab/azure-portal)
151
153
152
-
Use the following steps to enable a log streaming endpoint on the public network.
154
+
Use the following steps to enable a log streaming endpoint on the public network:
153
155
154
-
1. Select the Azure Spring Apps service instance deployed in your virtual network, and then open the **Networking** tab in the navigation menu.
156
+
1. Select the Azure Spring Apps service instance deployed in your virtual network and then select **Networking** in the navigation menu.
155
157
156
-
1. Select the **Vnet injection** page.
158
+
1. Select the **Vnet injection** tab.
157
159
158
-
1. Switch the status of **Dataplane resources on public network** to **enable** to enable a log streaming endpoint on the public network. This process will take a few minutes.
160
+
1. Switch the status of **Dataplane resources on public network** to **enable** to enable a log streaming endpoint on the public network. This process takes a few minutes.
159
161
160
-
:::image type="content" source="media/how-to-log-streaming/dataplane-public-endpoint.png" alt-text="Screenshot of enabling a log stream public endpoint on the Vnet Injection page." lightbox="media/how-to-log-streaming/dataplane-public-endpoint.png":::
162
+
:::image type="content" source="media/how-to-log-streaming/dataplane-public-endpoint.png" alt-text="Screenshot of the Azure portal that shows the Networking page with the Vnet injection tab selected and the Troubleshooting section highlighted." lightbox="media/how-to-log-streaming/dataplane-public-endpoint.png":::
161
163
162
164
#### [Azure CLI](#tab/azure-CLI)
163
165
164
-
Use the following command to enable the log stream public endpoint.
166
+
Use the following command to enable the log stream public endpoint:
165
167
166
168
```azurecli
167
169
az spring update \
@@ -172,7 +174,7 @@ az spring update \
172
174
173
175
---
174
176
175
-
After you've enabled the log stream public endpoint, you can access the app log from a public network as you would access a normal instance.
177
+
After you enable the log stream public endpoint, you can access the app log from a public network just like you would access a normal instance.
176
178
177
179
## Secure traffic to the log streaming public endpoint
178
180
@@ -181,7 +183,7 @@ Log streaming uses the same key as the test endpoint described in [Set up a stag
181
183
To ensure the security of your applications when you expose a public endpoint for them, secure the endpoint by filtering network traffic to your service with a network security group. For more information, see [Tutorial: Filter network traffic with a network security group using the Azure portal](../virtual-network/tutorial-filter-network-traffic.md). A network security group contains security rules that allow or deny inbound network traffic to, or outbound network traffic from, several types of Azure resources. For each rule, you can specify source and destination, port, and protocol.
182
184
183
185
> [!NOTE]
184
-
> If you can't access app logs in the virtual network injection instance from the internet after you've enabled a log stream public endpoint, check your network security group to see whether you've allowed such inbound traffic.
186
+
> If you can't access app logs in the virtual network injection instance from the internet after you enable a log stream public endpoint, check your network security group to see whether you allowed such inbound traffic.
185
187
186
188
The following table shows an example of a basic rule that we recommend. You can use commands like `nslookup` with the endpoint `<service-name>.private.azuremicroservices.io` to get the target IP address of a service.
187
189
@@ -194,3 +196,4 @@ The following table shows an example of a basic rule that we recommend. You can
194
196
195
197
-[Quickstart: Monitoring Azure Spring Apps apps with logs, metrics, and tracing](./quickstart-logs-metrics-tracing.md)
196
198
-[Analyze logs and metrics with diagnostics settings](./diagnostic-services.md)
199
+
-[Stream Azure Spring Apps managed component logs in real time](./how-to-managed-component-log-streaming.md)
0 commit comments