Skip to content

Commit 271fac7

Browse files
Merge pull request #227334 from cebundy/aca-logging-ui-changes
[Container Apps] Update log stream to include both system logs for env and app
2 parents 53edbbc + b7a107b commit 271fac7

File tree

8 files changed

+167
-36
lines changed

8 files changed

+167
-36
lines changed

articles/container-apps/log-options.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Container Apps application logs consist of two different categories:
1717

1818
- Container console output (`stdout`/`stderr`) messages.
1919
- System logs generated by Azure Container Apps.
20+
- Spring App console logs.
2021

2122
You can choose between these logs destinations:
2223

articles/container-apps/log-streaming.md

Lines changed: 157 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,72 @@ description: View your container app's log stream.
44
services: container-apps
55
author: cebundy
66
ms.service: container-apps
7-
ms.custom: event-tier1-build-2022
87
ms.topic: how-to
9-
ms.date: 08/30/2022
8+
ms.date: 03/24/2023
109
ms.author: v-bcatherine
1110
---
1211

1312
# View log streams in Azure Container Apps
1413

15-
While developing and troubleshooting your container app, it's important to see a container's logs in real-time. Container Apps lets you view a stream of your container's `stdout` and `stderr` log messages through the Azure portal or the Azure CLI.
14+
While developing and troubleshooting your container app, it's essential to see the [logs](logging.md) for your container app in real time. Azure Container Apps lets you stream:
1615

17-
## Azure portal
16+
- [system logs](logging.md#system-logs) from the Container Apps environment and your container app.
17+
- container [console logs](logging.md#container-console-logs) from your container app.
1818

19-
View a container app's log stream in the Azure portal with these steps.
19+
Log streams are accessible through the Azure portal or the Azure CLI.
2020

21-
1. Navigate to your container app in the Azure portal.
21+
## View log streams via the Azure portal
22+
23+
You can view system logs and console logs in the Azure portal. System logs are generated by the container app's runtime. Console logs are generated by your container app.
24+
25+
### Environment system log stream
26+
27+
To troubleshoot issues 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:
28+
29+
1. Go to your environment in the Azure portal.
2230
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.
2431

25-
After a container is selected, the log stream is displayed in the viewing pane.
32+
:::image type="content" source="media/observability/system-log-streaming-env.png" alt-text="Screenshot of Container Apps environment system log stream page.":::
2633

27-
:::image type="content" source="media/observability/log-stream.png" alt-text="Screenshot of Azure Container Apps Log stream page.":::
34+
### Container app log stream
35+
36+
You can view a log stream of your container app's system or console logs from your container app page.
37+
38+
1. Go to your container app in the Azure portal.
39+
1. Select **Log stream** under the *Monitoring* section on the sidebar menu.
40+
1. To view the console log stream, select **Console**.
41+
1. If you have multiple revisions, replicas, or containers, you can select from the drop-down menus to choose a container. If your app has only one container, you can skip this step.
2842

29-
## Azure CLI
43+
:::image type="content" source="media/observability/screenshot-log-stream-console-app.png" alt-text="Screenshot of Container Apps console log stream from app page.":::
3044

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:
45+
1. To view the system log stream, select **System**. The system log stream displays the system logs for all running containers in your container app.
3246

33-
- View previous log entries with the `--tail` argument.
34-
- View a live stream with the `--follow`argument.
47+
:::image type="content" source="media/observability/screenshot-log-stream-system-app.png" alt-text="Screenshot of Container Apps system log stream from app page.":::
3548

36-
Use `Ctrl/Cmd-C` to stop the live stream.
49+
## View log streams via the Azure CLI
3750

38-
For example, you can list the last 50 container log entries in a container app with a single container using the following command.
51+
You can view your container app's log streams 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.
3952

40-
This example live streams a container's log entries.
53+
Control the log stream with the following arguments:
54+
55+
- `--tail` (Default) View the last n log messages. Values are 0-300 messages. The default is 20.
56+
- `--follow` View a continuous live stream of the log messages.
57+
58+
### Stream Container app logs
59+
60+
You can stream the system or console logs for your container app. To stream the container app system logs, use the `--type` argument with the value `system`. To stream the container console logs, use the `--type` argument with the value `console`. The default is `console`.
61+
62+
#### View container app system log stream
63+
64+
This example uses the `--tail` argument to display the last 50 system log messages from the container app. Replace the \<placeholders\> with your container app's values.
4165

4266
# [Bash](#tab/bash)
4367

4468
```azurecli
4569
az containerapp logs show \
4670
--name <ContainerAppName> \
4771
--resource-group <ResourceGroup> \
72+
--type system \
4873
--tail 50
4974
```
5075

@@ -54,20 +79,49 @@ az containerapp logs show \
5479
az containerapp logs show `
5580
--name <ContainerAppName> `
5681
--resource-group <ResourceGroup> `
82+
--type system `
5783
--tail 50
5884
```
5985

6086
---
6187

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.
88+
This example displays a continuous live stream of system log messages from the container app using the `--follow` argument. Replace the \<placeholders\> with your container app's values.
89+
90+
# [Bash](#tab/bash)
91+
92+
```azurecli
93+
az containerapp logs show \
94+
--name <ContainerAppName> \
95+
--resource-group <ResourceGroup> \
96+
--type system \
97+
--follow
98+
```
99+
100+
# [PowerShell](#tab/powershell)
101+
102+
```azurecli
103+
az containerapp logs show `
104+
--name <ContainerAppName> `
105+
--resource-group <ResourceGroup> `
106+
--type system `
107+
--follow
108+
```
109+
110+
---
111+
112+
Use `Ctrl-C` or `Cmd-C` to stop the live stream.
113+
114+
### View container console log stream
115+
116+
To connect to a container's console log stream in a container app with multiple revisions, replicas, and containers, include the following parameters in the `az containerapp logs show` command.
63117

64118
| Argument | Description |
65119
|----------|-------------|
66-
| `--revision` | The revision name of the container to connect to. |
67-
| `--replica` | The replica name of the container to connect to. |
68-
| `--container` | The container name of the container to connect to. |
120+
| `--revision` | The revision name. |
121+
| `--replica` | The replica name in the revision. |
122+
| `--container` | The container name to connect to. |
69123

70-
You can get the revision names with the `az containerapp revision list` command. Replace the \<placeholders\> with your container app's values.
124+
You can get the revision names with the `az containerapp revision list` command. Replace the \<placeholders\> with your container app's values.
71125

72126
# [Bash](#tab/bash)
73127

@@ -113,8 +167,7 @@ az containerapp replica list `
113167

114168
---
115169

116-
Stream the container logs with the `az container app show` command. Replace the \<placeholders\> with your container app's values.
117-
170+
Live stream the container console using the `az container app show` command with the `--follow` argument. Replace the \<placeholders\> with your container app's values.
118171

119172
# [Bash](#tab/bash)
120173

@@ -125,6 +178,7 @@ az containerapp logs show \
125178
--revision <RevisionName> \
126179
--replica <ReplicaName> \
127180
--container <ContainerName> \
181+
--type console \
128182
--follow
129183
```
130184

@@ -137,13 +191,91 @@ az containerapp logs show `
137191
--revision <RevisionName> `
138192
--replica <ReplicaName> `
139193
--container <ContainerName> `
194+
--type console `
195+
--follow
196+
```
197+
198+
---
199+
200+
Use `Ctrl-C` or `Cmd-C` to stop the live stream.
201+
202+
View the last 50 console log messages using the `az containerapp logs show` command with the `--tail` argument. Replace the \<placeholders\> with your container app's values.
203+
204+
# [Bash](#tab/bash)
205+
206+
```azurecli
207+
az containerapp logs show \
208+
--name <ContainerAppName> \
209+
--resource-group <ResourceGroup> \
210+
--revision <RevisionName> \
211+
--replica <ReplicaName> \
212+
--container <ContainerName> \
213+
--type console \
214+
--tail 50
215+
```
216+
217+
# [PowerShell](#tab/powershell)
218+
219+
```azurecli
220+
az containerapp logs show `
221+
--name <ContainerAppName> `
222+
--resource-group <ResourceGroup> `
223+
--revision <RevisionName> `
224+
--replica <ReplicaName> `
225+
--container <ContainerName> `
226+
--type console `
227+
--tail 50
228+
```
229+
230+
---
231+
232+
### View environment system log stream
233+
234+
Use the following command with the `--follow` argument to view the live system log stream from the Container Apps environment. Replace the \<placeholders\> with your environment values.
235+
236+
# [Bash](#tab/bash)
237+
238+
```azurecli
239+
az containerapp env logs show \
240+
--name <ContainerAppEnvironmentName> \
241+
--resource-group <ResourceGroup> \
242+
--follow
243+
```
244+
245+
# [PowerShell](#tab/powershell)
246+
247+
```azurecli
248+
az containerapp env logs show `
249+
--name <ContainerAppEnvironmentName> `
250+
--resource-group <ResourceGroup> `
140251
--follow
141252
```
142253

143254
---
144255

256+
Use `Ctrl-C` or `Cmd-C` to stop the live stream.
145257

146-
Enter **Ctrl-C** to stop the log stream.
258+
This example uses the `--tail` argument to display the last 50 environment system log messages. Replace the \<placeholders\> with your environment values.
259+
260+
# [Bash](#tab/bash)
261+
262+
```azurecli
263+
az containerapp env logs show \
264+
--name <ContainerAppName> \
265+
--resource-group <ResourceGroup> \
266+
--tail 50
267+
```
268+
269+
# [PowerShell](#tab/powershell)
270+
271+
```azurecli
272+
az containerapp env logs show `
273+
--name <ContainerAppName> `
274+
--resource-group <ResourceGroup> `
275+
--tail 50
276+
```
277+
278+
---
147279

148280
> [!div class="nextstepaction"]
149-
> [View log streams from the Azure portal](log-streaming.md)
281+
> [Log storage and monitoring options in Azure Container Apps](log-monitoring.md)

articles/container-apps/logging.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,34 @@ ms.author: v-bcatherine
1414

1515
Azure Container Apps provides two types of application logging categories:
1616

17-
- [Container console logs](#container-console-logs): Log streams from your container console.
18-
- [System logs](#system-logs): Logs generated by the Azure Container Apps service.
17+
- [Container console logs](#container-console-logs): Log streams from your container console.
18+
- [System logs](#system-logs): Logs generated by the Azure Container Apps service.
1919

20+
You can view the [log streams](log-streaming.md) in near real-time in the Azure portal or CLI. For more options to store and monitor your logs, see [Logging options](log-options.md).
2021

2122
## Container console Logs
2223

23-
Container console logs are written by your application to the `stdout` and `stderr` output streams of the application's container. By implementing detailed logging in your application, you'll be able to troubleshoot issues and monitor the health of your application.
24-
25-
You can view your container console logs through [Logs streaming](log-streaming.md). For other options to store and monitoring your log data, see [Logging options](log-options.md).
24+
Container Apps captures the `stdout` and `stderr` output streams from your application containers and displays them as console logs. When you implement logging in your application, you can troubleshoot problems and monitor the health of your app.
2625

2726
## System logs
2827

29-
System logs are generated by the Azure Container Apps to inform you for the status of service level events. Log messages include the following information:
28+
Container Apps generates system logs to inform you of the status of service level events. Log messages include the following information:
3029

3130
- Successfully created dapr component
3231
- Successfully updated dapr component
3332
- Error creating dapr component
3433
- Successfully mounted volume
3534
- Error mounting volume
3635
- Successfully bound Domain
37-
- Auth enabled on app. Creating authentication config
36+
- Auth enabled on app
37+
- Creating authentication config
3838
- Auth config created successfully
39-
- Setting a traffic weight
39+
- Setting a traffic weight
4040
- Creating a new revision:
4141
- Successfully provisioned revision
4242
- Deactivating Old revisions
4343
- Error provisioning revision
4444

45-
The system log data can be stored and monitored through the Container Apps logging options. For more information, see [Logging options](log-options.md).
46-
4745
## Next steps
4846

4947
> [!div class="nextstepaction"]
Binary file not shown.
139 KB
Loading
265 KB
Loading
344 KB
Loading

articles/container-apps/observability.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ These features include:
1818

1919
|Feature |Description |
2020
|---------|---------|
21-
|[Log streaming](log-streaming.md) | View streaming console logs from a container in near real-time. |
21+
|[Log streaming](log-streaming.md) | View streaming system and console logs from a container in near real-time. |
2222
|[Container console](container-console.md) | Connect to the Linux console in your containers to debug your application from inside the container. |
2323
|[Azure Monitor metrics](metrics.md)| View and analyze your application's compute and network usage through metric data. |
2424
|[Application logging](logging.md) | Monitor, analyze and debug your app using log data.|

0 commit comments

Comments
 (0)