Skip to content

Commit 8cbc717

Browse files
committed
work in progress
1 parent cc7f2dd commit 8cbc717

File tree

2 files changed

+81
-24
lines changed

2 files changed

+81
-24
lines changed

articles/container-apps/log-streaming.md

Lines changed: 78 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@ ms.author: v-bcatherine
1212

1313
# View log streams in Azure Container Apps
1414

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.
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 app's [system logs](logging.md#system-logs) at the Container Apps environment level and at the app level. You can stream the [console logs](logging.md#container-console-logs) apps at the container level. Log streams are accessible though the Azure portal or the Azure CLI.
1616

17-
## Azure portal
17+
## View log streams via the Azure portal
1818

1919
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

2121
### Environment system log stream
2222

2323
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:
2424

25-
1. Go your environment page in the Azure portal.
25+
1. Go to your environment page in the Azure portal.
2626
1. Select **Log stream** under the *Monitoring* section on the sidebar menu.
2727

2828
:::image type="content" source="media/observability/system-log-streaming-env.png" alt-text="Screenshot of Container Apps environment system log stream page.":::
@@ -42,22 +42,21 @@ You can view a log stream of your container apps system or application logs from
4242

4343
:::image type="content" source="media/observability/screenshot-log-stream-system-app.png" alt-text="Screenshot of Container Apps system log stream from app page.":::
4444

45-
## Azure CLI
45+
## View log streams via the Azure CLI
4646

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.
47+
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.
4848

49-
You can use these arguments to:
49+
Control the log stream with the following arguments:
5050

51-
- View previous log entries with the `--tail` argument. (Values: 0-300)
52-
- View a live stream with the `--follow`argument.
51+
- `--tail` (Default) - View the last n log entries. Values are 0-300 entries. The value is 20.
52+
- `--follow` - View a continuous live stream of the log entries.
5353

54-
Use `Ctrl/Cmd-C` to stop the live stream.
54+
### Stream Container app logs
5555

56-
For example, you can list the last 50 container log entries in a container app with a single container using the following command.
56+
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`.
5757

58-
### View container app log stream from the CLI
5958

60-
Use the `--type` argument to specify the log type. Valid values are `console` and `system`. The default is `console`.
59+
#### View container app system log stream
6160

6261
This example displays the last 50 system log entries for the container app.
6362

@@ -83,7 +82,35 @@ az containerapp logs show `
8382

8483
---
8584

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.
85+
This example displays a continuous live stream of system log entries for the container app.
86+
87+
# [Bash](#tab/bash)
88+
89+
```azurecli
90+
az containerapp logs show \
91+
--name <ContainerAppName> \
92+
--resource-group <ResourceGroup> \
93+
--type system \
94+
--follow
95+
```
96+
97+
# [PowerShell](#tab/powershell)
98+
99+
```azurecli
100+
az containerapp logs show `
101+
--name <ContainerAppName> `
102+
--resource-group <ResourceGroup> `
103+
--type system `
104+
--follow
105+
```
106+
107+
---
108+
109+
Use `Ctrl-C` or `Cmd-C` to stop the live stream.
110+
111+
### View container console log stream
112+
113+
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.
87114

88115
| Argument | Description |
89116
|----------|-------------|
@@ -137,7 +164,7 @@ az containerapp replica list `
137164

138165
---
139166

140-
Stream the container console logs with the `az container app show` command. Replace the \<placeholders\> with your container app's values.
167+
Live stream the container console logs with the `az container app show` command. Replace the \<placeholders\> with your container app's values.
141168

142169
# [Bash](#tab/bash)
143170

@@ -167,14 +194,43 @@ az containerapp logs show `
167194

168195
---
169196

170-
Enter **Ctrl-C** to stop the log stream.
197+
Use `Ctrl-C` or `Cmd-C` to stop the live stream.
198+
199+
View the last 50 container console log entries with the `az containerapp logs show` command. Replace the \<placeholders\> with your container app's values.
200+
201+
202+
# [Bash](#tab/bash)
203+
204+
```azurecli
205+
az containerapp logs show \
206+
--name <ContainerAppName> \
207+
--resource-group <ResourceGroup> \
208+
--revision <RevisionName> \
209+
--replica <ReplicaName> \
210+
--container <ContainerName> \
211+
--type console \
212+
--tail 50
213+
```
171214

172-
### View environment system log stream from the CLI
215+
# [PowerShell](#tab/powershell)
173216

174-
Using the following command, you can view the system log stream for the Container Apps service and the apps running in the environment.
217+
```azurecli
218+
az containerapp logs show `
219+
--name <ContainerAppName> `
220+
--resource-group <ResourceGroup> `
221+
--revision <RevisionName> `
222+
--replica <ReplicaName> `
223+
--container <ContainerName> `
224+
--type console `
225+
--tail 50
226+
```
227+
228+
---
175229

176-
Stream the container logs with the `az container app env logs show` command. Replace the \<placeholders\> with your container app's values.
177230

231+
### View environment system log stream
232+
233+
Use the following command to view the live system log stream from the Container Apps service.
178234

179235
# [Bash](#tab/bash)
180236

@@ -196,14 +252,15 @@ az containerapp env logs show `
196252

197253
---
198254

199-
Enter **Ctrl-C** to stop the log stream.
255+
Use `Ctrl-C` or `Cmd-C` to stop the live stream.
256+
200257

201258
This example displays the last 50 environment system log entries.
202259

203260
# [Bash](#tab/bash)
204261

205262
```azurecli
206-
az containerapp logs show \
263+
az containerapp env logs show \
207264
--name <ContainerAppName> \
208265
--resource-group <ResourceGroup> \
209266
--tail 50
@@ -212,7 +269,7 @@ az containerapp logs show \
212269
# [PowerShell](#tab/powershell)
213270

214271
```azurecli
215-
az containerapp logs show `
272+
az containerapp env logs show `
216273
--name <ContainerAppName> `
217274
--resource-group <ResourceGroup> `
218275
--tail 50

articles/container-apps/logging.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ Azure Container Apps provides two types of application logging categories:
2222

2323
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.
2424

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).
25+
You can view your container console logs through [Logs streaming](log-streaming.md). For other options to store and monitor your log data, see [Logging options](log-options.md).
2626

2727
## System logs
2828

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:
29+
System logs are generated by the Azure Container Apps to inform you of the status of service level events. Log messages include the following information:
3030

3131
- Successfully created dapr component
3232
- Successfully updated dapr component
@@ -42,7 +42,7 @@ System logs are generated by the Azure Container Apps to inform you for the stat
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).
45+
The system log data can be stored and monitored through the Container Apps logging options or streamed through the Azure portal or CLI. For more information, see [Logging options](log-options.md) and [Log streams](log-streaming.md).
4646

4747
## Next steps
4848

0 commit comments

Comments
 (0)