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

Implement structured logging #1438

Merged
merged 6 commits into from Jan 26, 2024
Merged

Conversation

mohamed-essam
Copy link
Contributor

Description of the change

Change controller logging to use log/slog.

Benefits

  1. Allow structured logging.
  2. Allow changing logging format between text and JSON.
  3. Allow changing logging level.

Possible drawbacks

N/A

Applicable issues

Additional information

  • I took the liberty of removing log at line 91 in pkg/controller/main.go as it only served as a separator
  • To implement the functionality of --log-info-to-stdout, I had to implement a custom handler that would hand logs down to one of two slog.Loggers in place of the package in pkg/log that handled this previously

Signed-off-by: M Essam Hamed <github@messam.xyz>
Signed-off-by: M Essam Hamed <github@messam.xyz>
Signed-off-by: M Essam Hamed <github@messam.xyz>
@alemorcuq
Copy link
Collaborator

Thanks for submitting this PR, @mohamed-essam ! We will review it during this week.

Copy link
Collaborator

@alemorcuq alemorcuq left a comment

Choose a reason for hiding this comment

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

Thanks @mohamed-essam! Please, check my comments. The PR looks awesome.

cmd/controller/main.go Outdated Show resolved Hide resolved
cmd/controller/main.go Outdated Show resolved Hide resolved
pkg/controller/main.go Outdated Show resolved Hide resolved
helm/sealed-secrets/README.md Outdated Show resolved Hide resolved
helm/sealed-secrets/values.yaml Outdated Show resolved Hide resolved
pkg/controller/controller.go Outdated Show resolved Hide resolved
pkg/controller/main.go Outdated Show resolved Hide resolved
pkg/controller/server.go Outdated Show resolved Hide resolved
pkg/controller/main.go Outdated Show resolved Hide resolved
pkg/controller/main.go Outdated Show resolved Hide resolved
Signed-off-by: M Essam Hamed <github@messam.xyz>
cmd/controller/main.go Outdated Show resolved Hide resolved
Signed-off-by: M Essam Hamed <github@messam.xyz>
Signed-off-by: M Essam Hamed <github@messam.xyz>
Copy link
Collaborator

@alemorcuq alemorcuq left a comment

Choose a reason for hiding this comment

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

Thank you very much for this great PR, @mohamed-essam !

@alemorcuq alemorcuq merged commit 40c279f into bitnami-labs:main Jan 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Please Make Event Logging Verbosity Configurable
3 participants