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

Remove debug logging from keystore #15946

Merged
merged 1 commit into from
Jan 30, 2020
Merged

Conversation

urso
Copy link

@urso urso commented Jan 29, 2020

  • Refactoring

What does this PR do?

This changes removes debug logging from the keystore.

Why is it important?

Aim is to remove the need for global logger functions.

I first tried to pass a logger and fix up dependends. But then I realized that the keystore is loaded before the configuration file is loaded. The logging subsystem is only setup once the configuration file is loaded, which means that some debug messages are never printed anyways. Trying to pass a logger into the Keystore will have the keystore use an uninitialized logger.

When unpacking configs debug logs might have been written. These are also removed debug logs. But I don't think removing them is a big loss (debug log was only written if the key was actually found in the keystore...). @ph WDYT?

Checklist

  • My code follows the style guidelines of this project
    - [ ] I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
    - [ ] I have added tests that prove my fix is effective or that my feature works

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

The keystore is loaded before the configuration file is loaded, which
means that some debug messages are never printed, because logging is still
not initialized (logs will be discarded).
@urso urso added libbeat refactoring review Team:Services (Deprecated) Label for the former Integrations-Services team labels Jan 29, 2020
Copy link
Contributor

@ph ph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@urso urso merged commit 56924a3 into elastic:master Jan 30, 2020
@urso urso deleted the logp-global-keystore branch January 30, 2020 21:24
@urso urso added the v7.7.0 label Jan 30, 2020
urso pushed a commit to urso/beats that referenced this pull request Jan 30, 2020
The keystore is loaded before the configuration file is loaded, which
means that some debug messages are never printed, because logging is still
not initialized (logs will be discarded).

(cherry picked from commit 56924a3)
urso pushed a commit that referenced this pull request Jan 31, 2020
The keystore is loaded before the configuration file is loaded, which
means that some debug messages are never printed, because logging is still
not initialized (logs will be discarded).

(cherry picked from commit 56924a3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libbeat refactoring review Team:Services (Deprecated) Label for the former Integrations-Services team v7.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants