Skip to content

[improve][fn] Standardize log4j2 Root logger configuration to use system property - #26121

Merged
merlimat merged 3 commits into
apache:masterfrom
cognitree:function-loglevel-23783
Jul 1, 2026
Merged

[improve][fn] Standardize log4j2 Root logger configuration to use system property#26121
merlimat merged 3 commits into
apache:masterfrom
cognitree:function-loglevel-23783

Conversation

@sandeep-mst

Copy link
Copy Markdown
Contributor

Fixes #23783

Motivation

Both java_instance_log4j2.xml and kubernetes_instance_log4j2.xml had their Root logger levels hardcoded to 'info', which prevented the pulsar.log.level system property from controlling the actual logging level. While the system property was defined in both files, it was only being applied at the AppenderRef level.

Modifications

Updated both log4j2 configuration files in pulsar-functions/runtime-all/src/main/resources/:

  • Changed Root logger <level> from hardcoded info to ${sys:pulsar.log.level:-info}
  • Removed the <level> attribute from the AppenderRef element

Both files now consistently use the ${sys:pulsar.log.level} system property at the Root logger level, enabling proper dynamic log level control.

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

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

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

@sandeep-mst

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@sandeep-mst

Copy link
Copy Markdown
Contributor Author

@merlimat Please merge the PR if nothing else is required on it.

@merlimat
merlimat merged commit 373ab2b into apache:master Jul 1, 2026
81 of 83 checks passed
@sandeep-mst
sandeep-mst deleted the function-loglevel-23783 branch July 1, 2026 07:52
@lhotari lhotari added this to the 5.0.0-M2 milestone Jul 27, 2026
lhotari pushed a commit that referenced this pull request Aug 4, 2026
lhotari pushed a commit that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to Change the Log Level of Function Pods to Debug Level to View Debug Logs for Source, Sink, and Function for Kubernetes Runtime

3 participants