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

Give Zeno the logging it deserves #66

Merged
merged 17 commits into from
Jul 1, 2024
Merged

Give Zeno the logging it deserves #66

merged 17 commits into from
Jul 1, 2024

Conversation

equals215
Copy link
Member

@equals215 equals215 commented Jun 29, 2024

Zeno logging is chaotic and need to be standardized.
The current standard for logging is slog as it was recently introduced in the Go standard library.

  • multiHandler implements slog.Handler interface with support for multiple outputs, currently fixed with stdout and file output
  • file logging is done in json and stdout logging is in text format, both outputs' logging level can be configured

TODO :

  • replicate utils.SetupLogging() behaviour in log
    • ElasticSearch logging should be handled by log
    • Index rotation every day

@equals215 equals215 added the enhancement New feature or request label Jun 29, 2024
@equals215 equals215 requested a review from CorentinB June 29, 2024 14:37
@equals215 equals215 self-assigned this Jun 29, 2024
@equals215 equals215 marked this pull request as ready for review June 30, 2024 01:24
@equals215
Copy link
Member Author

yeah it works, elasticsearch log forwarder with slog implementation (sick huh?)

Screenshot 2024-06-29 at 9 26 34 PM

@equals215
Copy link
Member Author

@CorentinB your turn!

@equals215 equals215 changed the title Give Zeno the logging it desserves Give Zeno the logging it deserves Jun 30, 2024
@equals215
Copy link
Member Author

still need to add the capacity to specify log file path, will do in the upcoming CLI rewrite PR

Copy link
Collaborator

@CorentinB CorentinB left a comment

Choose a reason for hiding this comment

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

Looks VERY good to me. Once the few small changes requested are done, it's good to merge. Thanks!

cmd/utils.go Outdated Show resolved Hide resolved
config/config.go Outdated Show resolved Hide resolved
internal/pkg/log/elasticsearch.go Show resolved Hide resolved
internal/pkg/log/rotate.go Outdated Show resolved Hide resolved
Copy link
Member Author

@equals215 equals215 left a comment

Choose a reason for hiding this comment

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

done

@equals215 equals215 merged commit 48b6506 into main Jul 1, 2024
1 check passed
@equals215 equals215 deleted the enhance-logging branch July 1, 2024 02:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants