-
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
Migrate Netflow code to the logp logging library #42270
base: 8.x
Are you sure you want to change the base?
Conversation
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices) |
@@ -30,7 +30,7 @@ type Config struct { | |||
|
|||
var defaultCfg = Config{ | |||
protocols: []string{}, | |||
logOutput: io.Discard, | |||
logOutput: logp.L().Named("netflow"), |
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.
The godoc for Defaults()
says "log output is discarded".
With this line, it is hard to guarantee that is true because initialization order can affect logp.L()
. The global logger may or may not be initialized at the time at which this call is executed.
I didn't look at how this is used, but maybe it's better to separate the logger from the decoder config concept. And require that users of the decoders pass their own parent *logp.Logger
at construction time.
Proposed commit message
[Netflow] Migrate from log to the logp logging library
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Disruptive User Impact
Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs