-
Notifications
You must be signed in to change notification settings - Fork 145
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
feat: add slog logging #432
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
integrate with golang.org/x/exp/slog for logging. provide a middleware for request scoped logging. BREAKING CHANGES: 1. OpenIDProvider and sub-interfaces get a Logger() method to return the configured logger; 2. AuthRequestError now takes the complete Authorizer, instead of only the encoder. So that it may use its Logger() method. 3. RequestError now takes a Logger as argument.
without middleware for now
muhlemmer
force-pushed
the
feat-logging/slog
branch
from
August 25, 2023 10:11
d21e4a3
to
dd9d8f2
Compare
Codecov Report
@@ Coverage Diff @@
## next #432 +/- ##
==========================================
+ Coverage 53.34% 54.15% +0.81%
==========================================
Files 74 75 +1
Lines 5635 5724 +89
==========================================
+ Hits 3006 3100 +94
+ Misses 2376 2369 -7
- Partials 253 255 +2
|
4 tasks
livio-a
approved these changes
Aug 29, 2023
🎉 This PR is included in version 3.0.0-next.10 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 3.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change adds logging to oidc, using
/x/exp/slog
.In the OP logging is mostly done in the
AuthRequestError
andRequestError
functions. Request based logging can also be enable withzitadel/logging
'sMiddleware
. The example OP is adjust to show this behavior.The RP also gets the ability to log. Either from a context logger, or a fallback set directly on the RP.
slog is the new structured logging library which is already part of the standard library from go 1.21 in the log/slog package. As we support the last two major version of go, we must start by using the experimental version. Bevavior and API are mostly the same. After the release of Go 1.22, we can drop support for 1.20 and change all the imports to log/slog.
Depends on zitadel/logging#18 and subsequent release tagging.
Closes #379