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: docs/content.zh/docs/operations/helm.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,6 +76,8 @@ The configurable parameters of the Helm chart and which default values as detail
76
76
| defaultConfiguration.flink-conf.yaml | The default configuration of flink-conf.yaml. | kubernetes.operator.metrics.reporter.slf4j.factory.class: org.apache.flink.metrics.slf4j.Slf4jReporterFactory<br/>kubernetes.operator.metrics.reporter.slf4j.interval: 5 MINUTE<br/>kubernetes.operator.reconcile.interval: 15 s<br/>kubernetes.operator.observer.progress-check.interval: 5 s |
77
77
| defaultConfiguration.log4j-console.properties | The default configuration of log4j-console.properties. ||
78
78
| defaultConfiguration.log4j-operator.properties | The default configuration of log4j-operator.properties. ||
79
+
| defaultConfiguration.logback-operator.xml | The default configuration of logback-operator.xml. Used when `logging.framework` is set to `logback`. ||
80
+
| defaultConfiguration.logback-console.xml | The default configuration of logback-console.xml. Used when `logging.framework` is set to `logback`. ||
79
81
| fullnameOverride | Overrides the fullname with the specified full name. ||
80
82
| image.digest | The image tag of flink-kubernetes-operator. If set then it takes precedence and the image tag will be ignored. ||
81
83
| image.pullPolicy | The image pull policy of flink-kubernetes-operator. | IfNotPresent |
@@ -87,6 +89,7 @@ The configurable parameters of the Helm chart and which default values as detail
87
89
| jobServiceAccount.name | The name of job service account. | flink |
88
90
| jvmArgs.operator | The JVM start up options for operator. ||
89
91
| jvmArgs.webhook | The JVM start up options for webhook. ||
92
+
| logging.framework | The logging framework to use for the operator. Supported values: `log4j2`, `logback`. Controls which config files are mounted and which JVM flag is passed. | log4j2 |
90
93
| metrics.port | The metrics port on the container for default configuration. ||
91
94
| nameOverride | Overrides the name with the specified name. ||
92
95
| operatorHealth.livenessProbe | Liveness probe configuration for the operator using the health endpoint. Only time settings should be configured, endpoint is set automatically based on port. ||
Copy file name to clipboardExpand all lines: docs/content.zh/docs/operations/metrics-logging.md
+94-7Lines changed: 94 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -616,7 +616,33 @@ Once the custom resource is created in the Kubernetes environment the operator m
616
616
## Logging
617
617
The Operator controls the logging behaviour for Flink applications and the Operator itself using configuration files mounted externally via ConfigMaps. [Configuration files](https://github.com/apache/flink-kubernetes-operator/tree/main/helm/flink-kubernetes-operator/conf) with default values are shipped in the Helm chart. It is recommended to review and adjust them if needed in the `values.yaml` file before deploying the Operator in production environments.
618
618
619
-
To append/override the default log configuration properties for the operator and Flink deployments define the `log4j-operator.properties` and `log4j-console.properties` keys respectively:
619
+
The operator supports two logging frameworks: **Log4j2** (default) and **Logback**. Both sets of configuration files are shipped in the Helm chart and Docker image. The active framework is selected at install time via the `logging.framework` Helm value, either in `values.yaml` or on the command line:
620
+
621
+
```shell
622
+
# Use the default Log4j2 framework (explicit, same as omitting the flag)
1. Which logging configuration files are mounted into `/opt/flink/conf/`
631
+
2. Which JVM system property is passed to select the framework (`log4j.configurationFile` or `logback.configurationFile`)
632
+
3. Which SLF4J binding JAR is placed on the classpath at runtime
633
+
634
+
{{< hint info >}}
635
+
Logging in the operator is intentionally succinct and does not include contextual information such as namespace or name of the FlinkDeployment objects.
636
+
We rely on the MDC provided by the operator-sdk to access this information and use it directly in the log layout.
637
+
638
+
See the [Java Operator SDK docs](https://javaoperatorsdk.io/docs/features#contextual-info-for-logging-with-mdc) for more detail.
639
+
{{< /hint >}}
640
+
641
+
To learn more about accessing the job logs or changing the log level dynamically check the corresponding [section](https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/resource-providers/native_kubernetes/#logging) of the core documentation.
642
+
643
+
### Log4j2
644
+
645
+
Log4j2 is the default logging framework. To append/override the default log configuration properties for the operator and Flink deployments define the `log4j-operator.properties` and `log4j-console.properties` keys respectively:
620
646
621
647
```yaml
622
648
defaultConfiguration:
@@ -634,18 +660,60 @@ defaultConfiguration:
634
660
# monitorInterval = 30
635
661
```
636
662
637
-
{{< hint info >}}
638
-
Logging in the operator is intentionally succinct and does not include contextual information such as namespace or name of the FlinkDeployment objects.
639
-
We rely on the MDC provided by the operator-sdk to access this information and use it directly in the log layout.
663
+
### Logback
640
664
641
-
See the [Java Operator SDK docs](https://javaoperatorsdk.io/docs/features#contextual-info-for-logging-with-mdc) for more detail.
665
+
When using Logback, the equivalent configuration keys are `logback-operator.xml` and `logback-console.xml`:
**Logback XML overrides replace the entire default configuration.** Unlike Log4j2 `.properties` files where user entries are appended, XML files cannot be concatenated (two `<configuration>` root elements produce invalid XML). Ensure your custom `logback-operator.xml` or `logback-console.xml` is complete and self-contained. Logback supports only XML-based configuration and does not provide native support for `.properties` configuration files.
642
702
{{< /hint >}}
643
703
644
-
To learn more about accessing the job logs or changing the log level dynamically check the corresponding [section](https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/resource-providers/native_kubernetes/#logging) of the core documentation.
704
+
### Logging Library Version Overrides
705
+
706
+
The operator ships with **Logback 1.2.x** and **SLF4J 1.7.x**. These versions are bundled in the Docker image and the SLF4J 1.7.x API is shaded into the operator JAR.
707
+
708
+
{{< hint warning >}}
709
+
**Upgrading to Logback 1.4+/1.5+ or SLF4J 2.x is not supported.** SLF4J 2.x uses a `ServiceLoader`-based binding mechanism that is incompatible with the SLF4J 1.7.x API shaded inside the operator. Replacing the JARs at runtime will result in `ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder`.
710
+
{{< /hint >}}
645
711
646
712
### FlinkDeployment Logging Configuration
647
713
648
-
Users have the freedom to override the default `log4j-console.properties` settings on a per-deployment level by putting the entire log configuration into `spec.logConfiguration`:
714
+
Users have the freedom to override the default logging settings on a per-deployment level by putting the entire log configuration into `spec.logConfiguration`.
0 commit comments