-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
【RFC】Design of OpenIM Log Package Zap #387
Comments
/assign @kubernetes-on |
/assign |
Details
note |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨ |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
* fix: fix the err format * fix: change the error format * fix: wrap the errors * fix: wrap the flagParse error * fix: fix the InitFromConfig error format
This issue was closed because it has been stalled for 7 days with no activity. |
Design of OpenIM Log Package Zap
Introduction
Add an X-Request-ID field to all logs for a given HTTP request.
Disadvantages
Based on the above advantages and disadvantages, I propose the following solution:
zap
as the log package for OpenIMzap
is a high-performance, low-latency log package that supports log rotation and multiple output formatszap
is similar tologrus
, easy to use and learn, and provides multiple log levelsBy using
zap
, OpenIM will obtain better performance and more complete logging functions.Many excellent open source projects use
zap
as their log package, such as Kubernetes, etcd, and CockroachDB, as well as the k8s-iam project I am preparing in the future. Therefore, usingzap
as the log package for OpenIM is also a good choice.Why choose zap
Zap log package can be well compatible with glog. The encapsulation background is that when developing OpenIM , we found that glog was used extensively in the Kubernetes source code, and the log package needed to be compatible with glog.
Why choose /pkg/log directory
Migrate the log package to the
pkg/log
directory instead of pkg/common/log.
log
package belongs to the OpenIM project, and there are customization development contents;log
package has complete and mature functions, and external projects can also use it.Basic encapsulated log package support functions
Test repository
The text was updated successfully, but these errors were encountered: