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
vCluster outputs structured logs that help you monitor and troubleshoot your virtual clusters. You can configure the log format to suit your monitoring and analysis tools and workflows.
11
+
By default, vCluster creates logs in the control plane pod in console format, which is easy to read and preferred for manual log review. However, you can configure the logging in the control plane pod to JSON format. By enabling the JSON format, logs can be sent to external tools to aggregate logs across multiple virtual clusters to help monitor and troubleshoot these virtual clusters.
12
12
13
-
## Configure log encoding
14
-
15
-
You can set the log encoding format in your `vcluster.yaml` configuration:
13
+
## Log encoding formats
16
14
17
-
<InterpolatedCodeBlock
18
-
code={`logging:
19
-
encoding: [[VAR:ENCODING:json]]`}
20
-
language="yaml"
21
-
/>
15
+
vCluster supports two log encoding formats for the vCluster control plane pod.
22
16
23
-
Select either `json` or `console` for the `encoding` value.
17
+
- console (_Default_): Human-readable format. Ideal for development and manual log review.
18
+
- JSON: Structured format for log aggregation. Ideal for external monitoring and analysis tools.
24
19
25
20
:::note Platform logging
26
-
The `logging.encoding` setting only affects vCluster component logs. Platform-generated logs use a separate configuration.
21
+
The `logging.encoding` setting only affects vCluster control plane pod logs. Platform logs generated from a virtual cluster connected to the platform uses a separate configuration and will not be affected by these formats.
27
22
:::
28
23
29
-
## Log encoding formats
30
-
31
-
vCluster supports two log encoding formats:
32
-
33
-
-[console](#console-format) (_Default_): Human-readable format ideal for development and manual log review.
34
-
-[JSON](#json-format): Structured format for log aggregation and automated analysis.
35
-
36
24
### Console format
37
25
38
-
The console format provides human-readable logs with timestamps, log levels, source locations, and contextual information:
26
+
The console format provides human-readable logs with timestamps, log levels, source locations, and contextual information. The console format is best suited for use cases where users will be troubleshooting a single virtual cluster. Choose this format in environments where human readability is more important than structured log parsing. Example use cases include:
27
+
28
+
* Local development and testing, where developers benefit from quick, readable output
29
+
* Single virtual cluster analysis, where users will manually review logs and debug in a terminal
39
30
40
31
```text
41
32
2025-06-16 04:43:25 INFO license loader/inject.go:52 initializing license... {"component": "vcluster"}
@@ -44,11 +35,11 @@ The console format provides human-readable logs with timestamps, log levels, sou
44
35
2025-06-16 04:43:29 INFO online/license.go:146 rancher-integration {"component": "vcluster"}
45
36
```
46
37
47
-
The console format is best suited for local development and testing, where developers benefit from quick, readable output. It also works well for manual log review and debugging, especially when troubleshooting issues directly in the terminal. Choose this format in environments where human readability is more important than structured log parsing.
48
-
49
38
### JSON format
50
39
51
-
The JSON format structures log data for programmatic processing and integration with log management systems:
40
+
The JSON format structures log data for programmatic processing and integration with log management systems. The JSON format is best suited for use cases where external tools are used to monitor and analyze logs for multiple virtual clusters. Log aggregation tools (e.g. Elasticsearch or Splunk) can ingest these logs to support automated analysis, alerting, and integration with monitoring platforms (e.g. Prometheus and Grafana). Examples use cases include:
41
+
42
+
* Product environments where multiple virtual clusters are being monitored and logs from all of them need need to be parsed and processed automatically.
@@ -71,26 +62,22 @@ Each JSON log entry contains the following standard fields:
71
62
72
63
Additional fields might be displayed based on context and log content.
73
64
74
-
The JSON format is ideal for production environments where logs need to be parsed and processed automatically. It works well with log aggregation tools like Elasticsearch or Splunk and supports automated analysis, alerting, and integration with monitoring platforms such as Prometheus and Grafana.
75
-
76
-
## Examples
65
+
## Enable log encoding
77
66
78
-
### Development environment
67
+
Logging is enabled in your `vcluster.yaml` configuration file.
79
68
80
-
For local development with human-readable logs:
69
+
You can enable the JSON format of log encoding.
81
70
82
-
```yaml
71
+
```yaml
83
72
logging:
84
-
encoding: console
73
+
encoding: json
85
74
```
86
75
87
-
### Production environment
88
-
89
-
For production with structured logging and monitoring:
76
+
If you want to disable the JSON format, you can either remove the `logging` field or explicitly set the console format.
0 commit comments