Skip to content

[Chore][libbeat] Replace global logger with single logger instance #2#43493

Merged
pierrehilbert merged 85 commits intoelastic:mainfrom
khushijain21:locallogger-2
Apr 2, 2025
Merged

[Chore][libbeat] Replace global logger with single logger instance #2#43493
pierrehilbert merged 85 commits intoelastic:mainfrom
khushijain21:locallogger-2

Conversation

@khushijain21
Copy link
Copy Markdown
Contributor

@khushijain21 khushijain21 commented Mar 26, 2025

Proposed commit message

See https://github.com/elastic/ingest-dev/issues/5251

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.

How to test this PR locally

Run this test in x-pack/filebeat/fbreceiver

go test -run ^TestMultipleReceivers$ ./x-pack/filebeat/fbreceiver -v

Related issues

Copy link
Copy Markdown
Contributor

@leehinman leehinman left a comment

Choose a reason for hiding this comment

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

Looking good, thank you for doing this.

My only requested change is lets not change the formatting of the error messages in this PR.

@khushijain21 khushijain21 requested review from leehinman and rdner April 2, 2025 07:19
Copy link
Copy Markdown
Member

@rdner rdner left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, I found a suspicious line where I left my comment.

@pierrehilbert
Copy link
Copy Markdown
Contributor

@nfritts could we have someone to review here please?

@pierrehilbert pierrehilbert merged commit 8920a05 into elastic:main Apr 2, 2025
161 checks passed
@khushijain21 khushijain21 changed the title [Chore][libbeat] Replace global logger with single logger instance [Chore][libbeat] Replace global logger with single logger instance #2 Apr 3, 2025
@khushijain21 khushijain21 added the backport-8.19 Automated backport to the 8.19 branch label Jun 6, 2025
mergify bot pushed a commit that referenced this pull request Jun 6, 2025
…43493)

* [Chore] Use single logger instance

* Update x-pack/filebeat/fbreceiver/receiver_test.go

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>

* Update x-pack/filebeat/fbreceiver/receiver_test.go

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>

* libbeat/cmd is complete

* keep only libbeat changes

* keep only libbeat changes

* add libbeat/monitoring/report package

* add my fork

* use beat.Info.Logger

* remove cloudid

* remove println

* fix tests

* add libbeat/idxmgmt

* add libbeat/monitoring/report

* go mod tidy

* fix idxmgmt tests

* fixing and finishing things

* fix tests

* fix tests

* fix tests

* debugging statement

* stringify debug statement

* fixing tests

* fixing tests

* add libbeat/instrumentation

* update ea-libs

* fix lint

* fix tests and lint

* golangci lint

* initialize logger before using in instrumentation

* address review comments

* address review comments 2

* add libbeat/output & libbeat/template

* fix tests

* add libbeat/dashboards & libbeat/cfgfile

* add libbeat/dashboards & libbeat/cfgfile

* fix lint

* add libbeat/persistentcache

* mage check

* mage check

* merge and fix tests

* fix test

* add logger on metricbeat

* fix lint

* fix lint

* fix tests

* address review comments

* lint check

* fix lint

* fix lint

* fix lint

* fix lint

* fix lint

* fix lint in redis files

* lint fix

* fix lint

* fix lint and tests

* fix logstash test

* fix test reload functionality

* add integration build tag

* use t.TempDir and non-capitalize logged errors

* add linter check

* fix log discrepancy

* add nolint for errors starting with capitalized letter

* fix logger discrepancy

* add linting fixes

---------

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
(cherry picked from commit 8920a05)

# Conflicts:
#	filebeat/beater/filebeat.go
#	heartbeat/beater/heartbeat.go
#	libbeat/autodiscover/autodiscover_test.go
#	libbeat/cfgfile/reload.go
#	libbeat/cmd/instance/beat.go
#	libbeat/outputs/elasticsearch/client_integration_test.go
#	libbeat/outputs/elasticsearch/client_test.go
#	libbeat/outputs/logstash/logstash_integration_test.go
#	metricbeat/beater/metricbeat.go
khushijain21 added a commit that referenced this pull request Jun 6, 2025
…43493)

* [Chore] Use single logger instance

* Update x-pack/filebeat/fbreceiver/receiver_test.go

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>

* Update x-pack/filebeat/fbreceiver/receiver_test.go

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>

* libbeat/cmd is complete

* keep only libbeat changes

* keep only libbeat changes

* add libbeat/monitoring/report package

* add my fork

* use beat.Info.Logger

* remove cloudid

* remove println

* fix tests

* add libbeat/idxmgmt

* add libbeat/monitoring/report

* go mod tidy

* fix idxmgmt tests

* fixing and finishing things

* fix tests

* fix tests

* fix tests

* debugging statement

* stringify debug statement

* fixing tests

* fixing tests

* add libbeat/instrumentation

* update ea-libs

* fix lint

* fix tests and lint

* golangci lint

* initialize logger before using in instrumentation

* address review comments

* address review comments 2

* add libbeat/output & libbeat/template

* fix tests

* add libbeat/dashboards & libbeat/cfgfile

* add libbeat/dashboards & libbeat/cfgfile

* fix lint

* add libbeat/persistentcache

* mage check

* mage check

* merge and fix tests

* fix test

* add logger on metricbeat

* fix lint

* fix lint

* fix tests

* address review comments

* lint check

* fix lint

* fix lint

* fix lint

* fix lint

* fix lint

* fix lint in redis files

* lint fix

* fix lint

* fix lint and tests

* fix logstash test

* fix test reload functionality

* add integration build tag

* use t.TempDir and non-capitalize logged errors

* add linter check

* fix log discrepancy

* add nolint for errors starting with capitalized letter

* fix logger discrepancy

* add linting fixes

---------

Co-authored-by: Mauri de Souza Meneguzzo <mauri870@gmail.com>
khushijain21 pushed a commit that referenced this pull request Jun 9, 2025
…ingle logger instance #2 (#44687)

* [Chore][libbeat] Replace global logger with single logger instance (#43493)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants