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. |
urso
left a comment
There was a problem hiding this comment.
@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! |
What does this PR do?
Remove global logger for
libbeat/outputsandlibbeat/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#ProxyDialercommon.transport.tlscommon.tls#ReadPEMFileoutputs.elasticsearch.client#BulkReadItemStatus