-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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 global logger from outputs and monitoring #16761
Conversation
@ycombinator I think parts of this interfere with your refactoring. |
@urso , @ycombinator - yes they do, but I was already done with the changes when I saw the other PR. Don't worry about it, I will just rebase my PR once the other one is merged. |
Failing tests seem unrelated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@simitt all CI failures are some know collateral from the switch to go modules. Related tests are all green.
Reading through the PR I found a many places where errors are logged with %v
only. Please change these to use %+v
. Zap does not handle errors well or in an uniform manner, especially if errors are nested. In case of nested errors there is a high chance that the cause is not logged when using %v
. Some error types implement a custom fmt.Formatter
, and will only print the cause if the +
flag is parsed.
LGTM. Thank you for taking the time and doing so many changes at once! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
Remove global logger for
libbeat/outputs
andlibbeat/monitoring
.Why is it important?
Precondition for improved structured logging.
Checklist
- [ ] 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 worksAuthor's Checklist
Related issues
Developer Docs
Following public methods are changed to take a logger as first parameter now:
common.transport.transport#ProxyDialer
common.transport.tlscommon.tls#ReadPEMFile
outputs.elasticsearch.client#BulkReadItemStatus