-
Notifications
You must be signed in to change notification settings - Fork 4
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
consider replacing logrus #2
Comments
👍 on the stdlib ( |
👍 on I would like to work on replacing logrus to get familiar with containerd. |
I think the nice thing about slog is is it should (in theory) be useful for library code and then in a binary like containerd or dockerd this can be wrapped in a frontend such as logrus or whatever else. |
Yes; afaik, it was designed to be pluggable, so yes, consumers could still decide to use logrus or anything. Definitely in favor of using the stdlib interfaces (and context-logger) |
Currently shim's logs can't add a uniform slog supports setting a default logger, and it will be easier for other dependencies to use it once slog is integrated in standard library |
Moved this one over to the log repo to continue the discussion. Its not currently in scope for 2.0 but we could consider it here for any version. |
I'd suggest only consider this if there some actual benefits (and no downsides, eg. clunkier ux or more limited wrapping support). In the current comments I haven't seen any listed. In that case, I think there are more meaningful changes to spend time on. I consider "maintenance mode" a major plus for a logging library. I don't want to spend time porting its potential changes across codebase or syncing hell if components use different versions. I don't want this to be another "let's refactor all the errors because 🤷♂️ " and lose all capability to debug errors because of the removal of stacktraces. |
Just as a note on the purpose of this repository (from the README):
I expect that there will be some advantages of |
What is the problem you're trying to solve
logrus is in maintenance mode and is no longer receiving significant development beyond security and bugfixes. Structured logging has continued to evolve in Go and recently the standard-library
log/slog
package was accepted for inclusion in a future version of Go.Describe the solution you'd like
With containerd 2.0, we should consider replacing logrus with an alternative. Some possibilities:
log/slog
(via https://pkg.go.dev/golang.org/x/exp/slog for now, until it is integrated in the standard library)Additional context
Replacing logrus has changes for clients of containerd (such as Moby) and plugins like shims. We'd also need to adapt containerd's logging helper (
log.G(ctx)
) to work with a new logging implementation.The text was updated successfully, but these errors were encountered: