Skip to content

Commit 25b93e0

Browse files
Merge pull request #249601 from austonli/patch-37
Updating ContainerLogV2 docs
2 parents afd96df + acb6745 commit 25b93e0

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

articles/azure-monitor/containers/container-insights-logging-v2.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ ms.author: bwren
66
ms.subservice: logs
77
ms.custom: event-tier1-build-2022
88
ms.topic: conceptual
9-
ms.date: 07/18/2023
9+
ms.date: 08/28/2023
1010
ms.reviewer: aul
1111
---
1212

1313
# Enable the ContainerLogV2 schema
1414
Azure Monitor Container insights offers a schema for container logs, called ContainerLogV2. As part of this schema, there are fields to make common queries to view Azure Kubernetes Service (AKS) and Azure Arc-enabled Kubernetes data. In addition, this schema is compatible with [Basic Logs](../logs/basic-logs-configure.md), which offers a low-cost alternative to standard analytics logs.
1515

16-
ContainerLogV2 will be default schema for customers who will be onboarding container insights with Managed Identity Auth using ARM, Bicep, Terraform, Policy and Portal onboarding. ContainerLogV2 can be explicitly enabled through CLI version 2.51.0 or higher using Data collection settings.
16+
>[!NOTE]
17+
> ContainerLogV2 will be default schema for customers who will be onboarding container insights with Managed Identity Auth using ARM, Bicep, Terraform, Policy and Portal onboarding. ContainerLogV2 can be explicitly enabled through CLI version 2.51.0 or higher using Data collection settings.
1718
1819
The new fields are:
1920
* `ContainerName`
@@ -36,10 +37,15 @@ The new fields are:
3637
> [Export](../logs/logs-data-export.md) to Event Hub and Storage Account is not supported if the incoming LogMessage is not a valid JSON. For best performance, we recommend emitting container logs in JSON format.
3738
3839
## Enable the ContainerLogV2 schema
39-
Customers can enable the ContainerLogV2 schema at the cluster level through either the cluster's Data Collection Rule or ConfigMap. To enable the ContainerLogV2 schema, configure the cluster's ConfigMap. Learn more about ConfigMap in [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) and in [Azure Monitor documentation](./container-insights-agent-config.md#configmap-file-settings-overview).
40+
Customers can enable the ContainerLogV2 schema at the cluster level through either the cluster's Data Collection Rule (DCR) or ConfigMap. To enable the ContainerLogV2 schema, configure the cluster's ConfigMap. Learn more about ConfigMap in [Kubernetes documentation](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/) and in [Azure Monitor documentation](./container-insights-agent-config.md#configmap-file-settings-overview).
4041
Follow the instructions to configure an existing ConfigMap or to use a new one.
4142

42-
### Configure via an existing Data Collection Rule
43+
>[!NOTE]
44+
> Because ContainerLogV2 can be enabled through either the DCR and ConfigMap, when both are enabled the ContainerLogV2 setting of the ConfigMap will take precedence. Stdout and stderr logs will only be ingested to the ContainerLog table when both the DCR and ConfigMap are explicitly set to off.
45+
46+
### Configure via an existing Data Collection Rule (DCR)
47+
48+
## [Azure portal](#tab/configure-portal)
4349

4450
1. In the Insights section of your Kubernetes cluster, select the **Monitoring Settings** button from the top toolbar
4551

@@ -57,7 +63,12 @@ Follow the instructions to configure an existing ConfigMap or to use a new one.
5763

5864
![Screenshot that shows ContainerLogV2 enabled.](./media/container-insights-logging-v2/container-insights-v2-monitoring-settings-configured.png)
5965

66+
## [CLI](#tab/configure-CLI)
67+
68+
1. For configuring via CLI, use the corresponding [config file](./container-insights-cost-config.md#configuring-aks-data-collection-settings-using-azure-cli), update the `enableContainerLogV2` field in the config file to be true.
6069

70+
---
71+
6172
### Configure an existing ConfigMap
6273
This applies to the scenario where you have already enabled container insights for your AKS cluster and have [configured agent data collection settings](./container-insights-agent-config.md#configure-and-deploy-configmaps) using ConfigMap "_container-azm-ms-agentconfig.yaml_". If this ConfigMap doesn't yet have the `log_collection_settings.schema` field, you'll need to append the following section in this existing ConfigMap .yaml file:
6374

@@ -90,14 +101,14 @@ This applies to the scenario where you have already enabled container insights f
90101
>* The restart is a rolling restart for all ama-logs pods. It won't restart all of them at the same time.
91102

92103
## Multi-line logging in Container Insights (preview)
93-
Azure Monitor - Container insights now supports multiline logging. With this feature enabled, previously split container logs are stitched together and sent as single entries to the ContainerLogV2 table. Customers are able see container log lines upto to 64 KB (up from the existing 16 KB limit). If the stitched log line is larger than 64 KB, it gets truncated due to Log Analytics limits.
104+
Azure Monitor container insights now supports multiline logging. With this feature enabled, previously split container logs are stitched together and sent as single entries to the ContainerLogV2 table. Customers are able see container log lines upto to 64 KB (up from the existing 16 KB limit). If the stitched log line is larger than 64 KB, it gets truncated due to Log Analytics limits.
94105
Additionally, the feature also adds support for .NET and Go stack traces, which appear as single entries instead of being split into multiple entries in ContainerLogV2 table.
95106

96107
### Pre-requisites
97108

98109
Customers must [enable ContainerLogV2](./container-insights-logging-v2.md#enable-the-containerlogv2-schema) for multi-line logging to work.
99110

100-
### How to enable - This is currently a preview feature
111+
### How to enable
101112
Multi-line logging can be enabled by setting *enable_multiline_logs* flag to “true” in [the config map](https://github.com/microsoft/Docker-Provider/blob/ci_prod/kubernetes/container-azm-ms-agentconfig.yaml#L49)
102113

103114
### Next steps for Multi-line logging

0 commit comments

Comments
 (0)