Skip to content

Commit cc7f2dd

Browse files
committed
Update log stream to include both system logs for env and app
1 parent 648f07e commit cc7f2dd

File tree

5 files changed

+86
-11
lines changed

5 files changed

+86
-11
lines changed

articles/container-apps/log-streaming.md

Lines changed: 86 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,58 @@ While developing and troubleshooting your container app, it's important to see a
1616

1717
## Azure portal
1818

19-
View a container app's log stream in the Azure portal with these steps.
19+
You can view system logs and application logs in the Azure portal. System logs are generated by the container app's runtime. Application logs are generated by your container app's application.
2020

21-
1. Navigate to your container app in the Azure portal.
21+
### Environment system log stream
22+
23+
To troubleshoot issues with in your container app environment, you can view the system log stream from your environment page. The log stream displays the system logs for the Container Apps service and the apps actively running in the environment:
24+
25+
1. Go your environment page in the Azure portal.
26+
1. Select **Log stream** under the *Monitoring* section on the sidebar menu.
27+
28+
:::image type="content" source="media/observability/system-log-streaming-env.png" alt-text="Screenshot of Container Apps environment system log stream page.":::
29+
30+
### Container app log stream
31+
32+
You can view a log stream of your container apps system or application logs from your container app page.
33+
34+
1. Go to your container app in the Azure portal.
2235
1. Select **Log stream** under the *Monitoring* section on the sidebar menu.
23-
1. If you have multiple revisions, replicas, or containers, you can select from the pull-down menus to choose a container. If your app has only one container, you can skip this step.
36+
1. To view the console log stream, select **Console**.
37+
1. If you have multiple revisions, replicas, or containers, you can select from the pull-down menus to choose a container. If your app has only one container, you can skip this step.
2438

25-
After a container is selected, the log stream is displayed in the viewing pane.
39+
:::image type="content" source="media/observability/screenshot-log-stream-console-app.png" alt-text="Screenshot of Container Apps console log stream from app page.":::
2640

27-
:::image type="content" source="media/observability/log-stream.png" alt-text="Screenshot of Azure Container Apps Log stream page.":::
41+
1. To view the system log stream, select **System**. The system log stream displays the system logs for all running containers in the environment.
42+
43+
:::image type="content" source="media/observability/screenshot-log-stream-system-app.png" alt-text="Screenshot of Container Apps system log stream from app page.":::
2844

2945
## Azure CLI
3046

31-
You can view a container's log stream from the Azure CLI with the `az containerapp logs show` command. You can use these arguments to:
47+
You can view an active container's log stream from the Azure CLI with the `az containerapp logs show` command or your container app's environment system log stream with the `az containerapp env logs show` command. The environment system log stream displays the system logs for the Container Apps service and the apps running in the environment.
48+
49+
You can use these arguments to:
3250

33-
- View previous log entries with the `--tail` argument.
51+
- View previous log entries with the `--tail` argument. (Values: 0-300)
3452
- View a live stream with the `--follow`argument.
3553

3654
Use `Ctrl/Cmd-C` to stop the live stream.
3755

3856
For example, you can list the last 50 container log entries in a container app with a single container using the following command.
3957

40-
This example live streams a container's log entries.
58+
### View container app log stream from the CLI
59+
60+
Use the `--type` argument to specify the log type. Valid values are `console` and `system`. The default is `console`.
61+
62+
This example displays the last 50 system log entries for the container app.
4163

4264
# [Bash](#tab/bash)
4365

4466
```azurecli
4567
az containerapp logs show \
4668
--name <ContainerAppName> \
4769
--resource-group <ResourceGroup> \
70+
--type system \
4871
--tail 50
4972
```
5073

@@ -54,12 +77,13 @@ az containerapp logs show \
5477
az containerapp logs show `
5578
--name <ContainerAppName> `
5679
--resource-group <ResourceGroup> `
80+
--type system `
5781
--tail 50
5882
```
5983

6084
---
6185

62-
To connect to a container console in a container app with multiple revisions, replicas, and containers include the following parameters in the `az containerapp logs show` command.
86+
To connect to a container live console log stream in a container app with multiple revisions, replicas, and containers include the following parameters in the `az containerapp logs show` command.
6387

6488
| Argument | Description |
6589
|----------|-------------|
@@ -113,8 +137,7 @@ az containerapp replica list `
113137

114138
---
115139

116-
Stream the container logs with the `az container app show` command. Replace the \<placeholders\> with your container app's values.
117-
140+
Stream the container console logs with the `az container app show` command. Replace the \<placeholders\> with your container app's values.
118141

119142
# [Bash](#tab/bash)
120143

@@ -125,6 +148,7 @@ az containerapp logs show \
125148
--revision <RevisionName> \
126149
--replica <ReplicaName> \
127150
--container <ContainerName> \
151+
--type console \
128152
--follow
129153
```
130154

@@ -137,13 +161,64 @@ az containerapp logs show `
137161
--revision <RevisionName> `
138162
--replica <ReplicaName> `
139163
--container <ContainerName> `
164+
--type console `
140165
--follow
141166
```
142167

143168
---
144169

170+
Enter **Ctrl-C** to stop the log stream.
171+
172+
### View environment system log stream from the CLI
173+
174+
Using the following command, you can view the system log stream for the Container Apps service and the apps running in the environment.
175+
176+
Stream the container logs with the `az container app env logs show` command. Replace the \<placeholders\> with your container app's values.
177+
178+
179+
# [Bash](#tab/bash)
180+
181+
```azurecli
182+
az containerapp env logs show \
183+
--name <ContainerAppEnvironmentName> \
184+
--resource-group <ResourceGroup> \
185+
--follow
186+
```
187+
188+
# [PowerShell](#tab/powershell)
189+
190+
```azurecli
191+
az containerapp env logs show `
192+
--name <ContainerAppEnvironmentName> `
193+
--resource-group <ResourceGroup> `
194+
--follow
195+
```
196+
197+
---
145198

146199
Enter **Ctrl-C** to stop the log stream.
147200

201+
This example displays the last 50 environment system log entries.
202+
203+
# [Bash](#tab/bash)
204+
205+
```azurecli
206+
az containerapp logs show \
207+
--name <ContainerAppName> \
208+
--resource-group <ResourceGroup> \
209+
--tail 50
210+
```
211+
212+
# [PowerShell](#tab/powershell)
213+
214+
```azurecli
215+
az containerapp logs show `
216+
--name <ContainerAppName> `
217+
--resource-group <ResourceGroup> `
218+
--tail 50
219+
```
220+
221+
---
222+
148223
> [!div class="nextstepaction"]
149224
> [View log streams from the Azure portal](log-streaming.md)
Binary file not shown.
139 KB
Loading
265 KB
Loading
344 KB
Loading

0 commit comments

Comments
 (0)