应用日志和请求跟踪数据会被发送并集中存储到 Azure
原文依据:3 处指南启用 Application Insights SDK,并说明控制台日志包含应用写入 stdout/stderr 的所有内容,请求级跟踪还会收集响应时间与依赖关系。同一 Container Apps 环境中的应用共享工作区。
如果应用把个人数据、令牌、请求正文或其他机密写入日志或跟踪属性,这些数据可能进入共享 Azure 工作区,并对拥有该工作区读取权限的人可见。
该指南明确要求为容器应用设置连接字符串并加入遥测 SDK;启用后,请求级跟踪、响应时间和依赖关系可发送到 Application Insights。它还说明容器写入 stdout/stderr 的全部内容会成为控制台日志,并且同一环境中的应用默认共享 Log Analytics 工作区。若日志含个人数据、令牌或业务内容,这些数据会被集中保存。用户可要求作者说明采集范围、脱敏、采样、保留期及 Azure 访问控制。
> 💡 **Tip:** All apps in the same environment share the workspace. Use `--logs-destination none` only for BYOB (bring-your-own-backend) scenarios.## System Logs vs Application Logs| Log Table | Content | Retention ||-----------|---------|-----------|| `ContainerAppConsoleLogs_CL` | stdout/stderr from containers | Workspace default || `ContainerAppSystemLogs_CL` | Platform events (scaling, restarts, image pulls) | Workspace default |> ⚠️ **Note:** The `_CL` suffix and `_s` column suffixes apply to the **Log Analytics** destination. Environments using the newer **Azure Monitor** destination use `ContainerAppConsoleLogs` / `ContainerAppSystemLogs` (no `_CL`, no `_s` suffixes). Check your environment's log destination to use the correct table name.System logs capture events outside your code—replica scheduling, health probe results, and revision activation. Console logs capture everything your app writes to stdout/stderr.查看另外 2 个位置
> ⚠️ **Warning:** Built-in metrics cover infrastructure only. For request-level tracing, response times, and dependency tracking, add Application Insights SDK.## Application Insights SDK SetupSet `APPLICATIONINSIGHTS_CONNECTION_STRING` as an environment variable on the container app, then add the SDK per language:System logs capture events outside your code—replica scheduling, health probe results, and revision activation. Console logs capture everything your app writes to stdout/stderr.