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/container-apps/log-streaming.md
+78-21Lines changed: 78 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,17 +12,17 @@ ms.author: v-bcatherine
12
12
13
13
# View log streams in Azure Container Apps
14
14
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.
16
16
17
-
## Azure portal
17
+
## View log streams via the Azure portal
18
18
19
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.
20
20
21
21
### Environment system log stream
22
22
23
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
24
25
-
1. Go your environment page in the Azure portal.
25
+
1. Go to your environment page in the Azure portal.
26
26
1. Select **Log stream** under the *Monitoring* section on the sidebar menu.
27
27
28
28
:::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
42
42
43
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.":::
44
44
45
-
## Azure CLI
45
+
## View log streams via the Azure CLI
46
46
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.
48
48
49
-
You can use these arguments to:
49
+
Control the log stream with the following arguments:
50
50
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.
53
53
54
-
Use `Ctrl/Cmd-C` to stop the live stream.
54
+
### Stream Container app logs
55
55
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`.
57
57
58
-
### View container app log stream from the CLI
59
58
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
61
60
62
61
This example displays the last 50 system log entries for the container app.
63
62
@@ -83,7 +82,35 @@ az containerapp logs show `
83
82
84
83
---
85
84
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.
87
114
88
115
| Argument | Description |
89
116
|----------|-------------|
@@ -137,7 +164,7 @@ az containerapp replica list `
137
164
138
165
---
139
166
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.
141
168
142
169
# [Bash](#tab/bash)
143
170
@@ -167,14 +194,43 @@ az containerapp logs show `
167
194
168
195
---
169
196
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
+
```
171
214
172
-
### View environment system log stream from the CLI
215
+
#[PowerShell](#tab/powershell)
173
216
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
+
---
175
229
176
-
Stream the container logs with the `az container app env logs show` command. Replace the \<placeholders\> with your container app's values.
177
230
231
+
### View environment system log stream
232
+
233
+
Use the following command to view the live system log stream from the Container Apps service.
178
234
179
235
# [Bash](#tab/bash)
180
236
@@ -196,14 +252,15 @@ az containerapp env logs show `
196
252
197
253
---
198
254
199
-
Enter **Ctrl-C** to stop the log stream.
255
+
Use `Ctrl-C` or `Cmd-C` to stop the live stream.
256
+
200
257
201
258
This example displays the last 50 environment system log entries.
Copy file name to clipboardExpand all lines: articles/container-apps/logging.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,11 @@ Azure Container Apps provides two types of application logging categories:
22
22
23
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
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).
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).
26
26
27
27
## System logs
28
28
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:
30
30
31
31
- Successfully created dapr component
32
32
- Successfully updated dapr component
@@ -42,7 +42,7 @@ System logs are generated by the Azure Container Apps to inform you for the stat
42
42
- Deactivating Old revisions
43
43
- Error provisioning revision
44
44
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).
0 commit comments