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/azure-monitor/containers/container-insights-logging-v2.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,14 +6,15 @@ ms.author: bwren
6
6
ms.subservice: logs
7
7
ms.custom: event-tier1-build-2022
8
8
ms.topic: conceptual
9
-
ms.date: 07/18/2023
9
+
ms.date: 08/28/2023
10
10
ms.reviewer: aul
11
11
---
12
12
13
13
# Enable the ContainerLogV2 schema
14
14
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.
15
15
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.
17
18
18
19
The new fields are:
19
20
*`ContainerName`
@@ -36,10 +37,15 @@ The new fields are:
36
37
> [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.
37
38
38
39
## 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).
40
41
Follow the instructions to configure an existing ConfigMap or to use a new one.
41
42
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)
43
49
44
50
1. In the Insights section of your Kubernetes cluster, select the **Monitoring Settings** button from the top toolbar
45
51
@@ -57,7 +63,12 @@ Follow the instructions to configure an existing ConfigMap or to use a new one.
57
63
58
64

59
65
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.
60
69
70
+
---
71
+
61
72
### Configure an existing ConfigMap
62
73
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:
63
74
@@ -90,14 +101,14 @@ This applies to the scenario where you have already enabled container insights f
90
101
>* The restart is a rolling restart for all ama-logs pods. It won't restart all of them at the same time.
91
102
92
103
## 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.
94
105
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.
95
106
96
107
### Pre-requisites
97
108
98
109
Customers must [enable ContainerLogV2](./container-insights-logging-v2.md#enable-the-containerlogv2-schema) for multi-line logging to work.
99
110
100
-
### How to enable - This is currently a preview feature
111
+
### How to enable
101
112
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)
0 commit comments