Skip to content

Rebind Log4j2Metrics when LoggerContext#reconfigure is called #5756

@ddavidzhang

Description

@ddavidzhang

Describe the bug
Now,log4j2Metrics is registed when server starting up. But when Log4j2 LoggerContexted is reconfigured because of config being changed, the filter will not work.

Environment

  • Micrometer version : 1.9.15 and 1.12.3
  • Micrometer registry : prometheus
  • OS: ALL
  • Java version: jdk 8 and jdk 21

To Reproduce
How to reproduce the bug:
After a spring server starts up, we change some log4j2's config, logging level for example and Log4j2's reconfigure will be triggered. After this, the filter in log4j2Metrics will not work.

Expected behavior
log4j2Metrics always work

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementA general enhancementinstrumentationAn issue that is related to instrumenting a componentmodule: micrometer-coreAn issue that is related to our core module

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions