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

Migrate Netflow code to the logp logging library #42270

Open
wants to merge 3 commits into
base: 8.x
Choose a base branch
from

Conversation

jrmolin
Copy link

@jrmolin jrmolin commented Jan 8, 2025

Proposed commit message

[Netflow] Migrate from log to the logp logging library

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
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Disruptive User Impact

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Use cases

Screenshots

Logs

@jrmolin jrmolin added cleanup Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution labels Jan 8, 2025
@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jan 8, 2025
@mergify mergify bot assigned jrmolin Jan 8, 2025
@jrmolin jrmolin marked this pull request as ready for review January 14, 2025 17:26
@jrmolin jrmolin requested a review from a team as a code owner January 14, 2025 17:26
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@elasticmachine
Copy link
Collaborator

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"),
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Security-Deployment and Devices Deployment and Devices Team in Security Solution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants