Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with log4j2 metrics not getting disabled #1068

Merged
merged 1 commit into from
Nov 4, 2022
Merged

Conversation

jasonjkeller
Copy link
Contributor

Fixes a bug where the below logic could evaluate to true even if application logging was disabled at the top level (i.e. application_logging.enabled: false):

        if (isApplicationLoggingEnabled() && getParent() == null || !isAdditive()) {...}

If the entire application_logging stanza is disabled at the top level it should result in all related features being disabled regardless of how they are set.

In this case, where the metrics feature is still enabled, the code would make it past the above logic and still generate logging metrics.

  application_logging:
    enabled: false
    forwarding:
      enabled: true
      max_samples_stored: 10000
    local_decorating:
      enabled: true
    metrics:
      enabled: true

@jasonjkeller jasonjkeller merged commit 66e53c7 into main Nov 4, 2022
@jasonjkeller jasonjkeller deleted the log4j2-bug-fix branch November 4, 2022 21:49
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.

2 participants