Skip to content

Commit 5e46d15

Browse files
committed
Clarify dynamic sessions logging
1 parent b8a5a5e commit 5e46d15

2 files changed

Lines changed: 51 additions & 5 deletions

File tree

articles/container-apps/sessions-custom-container.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ When your application requests a session, an instance is instantly allocated fro
3434
## Related content
3535

3636
* [Serverless code interpreter sessions in Azure Container Apps](sessions-code-interpreter.md)
37+
* [Dynamic sessions custom container sample (GitHub)](https://github.com/Azure-Samples/dynamic-sessions-custom-container)

articles/container-apps/sessions-usage.md

Lines changed: 50 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The pool management endpoint follows this format:
2626
https://<SESSION_POOL_NAME>.<ENVIRONMENT_ID>.<REGION>.azurecontainerapps.io
2727
```
2828

29-
For more information managing session pools, see [session pools management endpoint](./session-pool.md#management-endpoint).
29+
For more information on managing session pools, see [session pools management endpoint](./session-pool.md#management-endpoint).
3030

3131
To send a request into a session's container, you use the management endpoint as the root for your request. Anything in the path following the base pool management endpoint is forwarded to the session's container.
3232

@@ -38,7 +38,7 @@ As you continue to make calls to the same session, the session remains [allocate
3838

3939
## Sample request
4040

41-
The following example shows how to send request to a session using a user's ID as the session unique identifier.
41+
The following example shows how to send a request to a session using a user's ID as the session unique identifier.
4242

4343
Before you send the request, replace the placeholders between the `<>` brackets with values specific to your request.
4444

@@ -109,9 +109,9 @@ az role assignment create \
109109
--scope <SESSION_POOL_RESOURCE_ID>
110110
```
111111

112-
If you're using an [large language model (LLM) framework integration](sessions-code-interpreter.md#llm-framework-integrations), the framework handles the token generation and management for you. Ensure that the application is configured with a managed identity with the necessary role assignments on the session pool.
112+
If you're using a [large language model (LLM) framework integration](sessions-code-interpreter.md#llm-framework-integrations), the framework handles the token generation and management for you. Ensure that the application is configured with a managed identity with the necessary role assignments on the session pool.
113113

114-
If you're using the pool's management API endpoints directly, you must generate a token and include it in the `Authorization` header of your HTTP requests. In addition to the role assignments previously mentioned, token needs to contain an audience (`aud`) claim with the value `https://dynamicsessions.io`.
114+
If you're using the pool's management API endpoints directly, you must generate a token and include it in the `Authorization` header of your HTTP requests. In addition to the role assignments previously mentioned, the token needs to contain an audience (`aud`) claim with the value `https://dynamicsessions.io`.
115115

116116
##### [Azure CLI](#tab/cli)
117117

@@ -310,7 +310,52 @@ This template contains the following settings for managed identity:
310310

311311
## Logging
312312

313-
Console logs from containers running in a session are available in the Azure Log Analytics workspace associated with the Azure Container Apps environment in a table named `AppEnvSessionConsoleLogs_CL`.
313+
Azure Container Apps dynamic sessions integrate with Azure Monitor and Log Analytics to collect logs emitted during session execution. Logging behavior is consistent across code interpreter and custom container session pools, and is distinct from metrics returned via API response headers.
314+
315+
### Log destinations
316+
317+
When Log Analytics is selected as the logging destination for the Container Apps environment, session logs are written to the configured Log Analytics workspace and can be queried using [Kusto Query Language (KQL)](/azure/data-explorer/kusto/query/).
318+
319+
### Available Log Analytics tables
320+
321+
The following Log Analytics tables are created for session logs when logs are emitted. For a full list of supported categories on the environment resource (`Microsoft.App/managedEnvironments`), see [Supported logs for Microsoft.App/managedEnvironments](/azure/azure-monitor/reference/supported-logs/microsoft-app-managedenvironments-logs).
322+
323+
| Session type | Log category | Log Analytics table | Description |
324+
|-------------|--------------|---------------------|-------------|
325+
| Code interpreter sessions (platform-managed) | Application logs | `AppEnvSessionConsoleLogs_CL` | Standard output (`stdout`) and standard error (`stderr`) emitted by code running in the session. Logs appear after a session is invoked. |
326+
| Code interpreter sessions (platform-managed) | Platform logs | Not applicable | Session lifecycle and pool event logs aren't emitted for code interpreter session pools. |
327+
| Custom container sessions | Application logs | `AppEnvSessionConsoleLogs_CL` | Standard output (`stdout`) and standard error (`stderr`) emitted by the containerized application. Azure Container Apps does not generate application logs for custom containers; you must emit logs from your container. |
328+
| Custom container sessions | Platform logs | `AppEnvSessionLifecycleLogs_CL`, `AppEnvSessionPoolEventLogs_CL` | Platform-generated events related to session pool allocation, lifecycle, and operational state. |
329+
330+
These tables are created when logs are first emitted. If no sessions have been invoked, the tables might not yet appear in the workspace.
331+
332+
Table names include the _CL suffix when logs are sent directly to Log Analytics. When logs are routed through Azure Monitor diagnostic settings, the table names don't include the _CL suffix.
333+
334+
### Log availability by session type
335+
336+
#### Code interpreter sessions (platform-managed built-in containers)
337+
338+
- **Application logs**
339+
Output written to `stdout` or `stderr` is captured in the `AppEnvSessionConsoleLogs_CL` table.
340+
341+
- **Platform logs**
342+
Session lifecycle and pool event logs aren't emitted for code interpreter session pools.
343+
344+
- **Metrics**
345+
Usage and execution metrics are returned as HTTP response headers for the Execute Code API only. These metrics aren't written to Log Analytics.
346+
347+
#### Custom container sessions
348+
349+
- **Application logs**
350+
Logs are captured only if the containerized application writes output to `stdout` or `stderr`.
351+
These logs appear in the `AppEnvSessionConsoleLogs_CL` table.
352+
353+
- **Platform logs**
354+
Session pool allocation and lifecycle events are captured in `AppEnvSessionLifecycleLogs_CL` and `AppEnvSessionPoolEventLogs_CL`.
355+
356+
- **Customer responsibility**
357+
Azure Container Apps doesn't generate application-level logs for custom containers. You must emit logs from within your containerized applications.
358+
314359

315360
## Related content
316361

0 commit comments

Comments
 (0)