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

fix(logs): Fix duplication of logs sent to fluentbit #2722

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

e-sumin
Copy link
Contributor

@e-sumin e-sumin commented Mar 6, 2024

Change Overview

Currently we have an issue with logger, when SetOutput is invoked with the FluentbitSink output, each logged messages is sent to fluentbit 7 times.

The issue is caused by cloneGlobalLogger, when we are iterating hooks and adding each hook to the entry, we are actually adding each hook 7 times (logrus internally iterates over each hook levels (7 is a number of log levels supported by hook).

Pull request type

Please check the type of change your PR introduces:

  • 🚧 Work in Progress
  • 🌈 Refactoring (no functional changes, no api changes)
  • 🐹 Trivial/Minor
  • 🐛 Bugfix
  • 🌻 Feature
  • 🗺️ Documentation
  • 🤖 Test

Issues

  • fixes #issue-number

Test Plan

  • 💪 Manual
  • ⚡ Unit test
  • 💚 E2E

@infraq infraq added this to In Progress in Kanister Mar 6, 2024
@e-sumin e-sumin requested a review from denisvmedia March 6, 2024 20:51
@julio-lopez
Copy link
Contributor

Can we add a test to prevent a future regression please?

@e-sumin
Copy link
Contributor Author

e-sumin commented Mar 7, 2024

@julio-lopez added.

Copy link
Contributor

@viveksinghggits viveksinghggits left a comment

Choose a reason for hiding this comment

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

LGTM

Kanister automation moved this from In Progress to Reviewer approved Mar 12, 2024
@e-sumin e-sumin added the kueue label Mar 12, 2024
@mergify mergify bot merged commit 94a8a33 into master Mar 12, 2024
14 checks passed
Kanister automation moved this from Reviewer approved to Done Mar 12, 2024
@mergify mergify bot deleted the fix_logs_duplication branch March 12, 2024 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants