Skip to content

[FLINK-39501] Logback Support in Flink Kubernetes Operator#1096

Open
Dennis-Mircea wants to merge 1 commit intoapache:mainfrom
Dennis-Mircea:FLINK-39501
Open

[FLINK-39501] Logback Support in Flink Kubernetes Operator#1096
Dennis-Mircea wants to merge 1 commit intoapache:mainfrom
Dennis-Mircea:FLINK-39501

Conversation

@Dennis-Mircea
Copy link
Copy Markdown
Contributor

What is the purpose of the change

This pull request introduces Logback as an alternative logging framework for the Flink Kubernetes Operator, selectable at install time via the logging.framework Helm value. Previously, only Log4j2 was supported.

Note: This change covers the main operator module only. The flink-autoscaler-standalone, which runs as an independent process with its own logging stack, is not included in this scope.

Brief change log

  • Add default logback-operator.xml and logback-console.xml configuration files with log output format aligned to the existing Log4j2 defaults
  • Add logging.framework Helm value to switch between log4j2 (default) and logback at install time
  • Update docker-entrypoint.sh to place the correct SLF4J binding JAR on the classpath based on the selected framework
  • Update Helm deployment template to mount the appropriate logging config files and pass the correct JVM system property
  • Fix ConfigMap template to use a replacement strategy for Logback XML overrides (XML cannot be concatenated like .properties files)
  • Add E2E tests for both Log4j2 and Logback logging verification (test_log4j2_logging.sh, test_logback_logging.sh)
  • Wire logging E2E tests into the CI pipeline (e2e_logging job in ci.yml)
  • Update Metrics and Logging documentation (English and Chinese) with framework selection, configuration examples, XML override behavior, and SLF4J version constraints

Verifying this change

This change added tests and can be verified as follows:

  • Added test_log4j2_logging.sh E2E test that deploys the operator with the default Log4j2 framework and verifies log format (timestamp with , millisecond separator, logger name, log level)
  • Added test_logback_logging.sh E2E test that switches the framework to Logback via values.yaml and verifies log format (timestamp with . millisecond separator, logger name, log level)
  • Both tests strip ANSI escape codes and validate format using POSIX-compatible regex patterns
  • Helm unit tests pass: helm unittest -f 'tests/**/*_test.yaml' helm/flink-kubernetes-operator (14 suites, 60 tests)
  • Manually verified by deploying the operator with both --set logging.framework=log4j2 and --set logging.framework=logback, confirming correct log output format in kubectl logs

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): yes
  • The public API, i.e., is any changes to the CustomResourceDescriptors: no
  • Core observer or reconciler logic that is regularly executed: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant