-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: clean up the logging component #23534
*: clean up the logging component #23534
Conversation
This is the first step for the task "Unify Log Framework". |
@SabaPing thanks for your contribution, could you file a PR to discuss the proposal in the community? Edit (2021/03/29): you can find the proposal template here: https://github.com/pingcap/tidb/blob/master/docs/design/TEMPLATE.md |
Sure I'll finish the proposal in this week. |
I think you can just post your doc in the sig channel. However remember to make it public. @SabaPing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/merge |
@xhebox: In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
/LGTM |
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by writing |
@SabaPing Rabase plz? I think we can merge the PR now. |
# Conflicts: # tidb-server/main.go
Done rebased |
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 7c7cde3
|
/merge |
if len(os.Getenv("GRPC_DEBUG")) > 0 { | ||
grpclog.SetLoggerV2(grpclog.NewLoggerV2WithVerbosity(os.Stderr, os.Stderr, os.Stderr, 999)) | ||
} else { | ||
grpclog.SetLoggerV2(grpclog.NewLoggerV2(io.Discard, io.Discard, os.Stderr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug comes from previously we just Discard these logs @SabaPing
var SlowQueryZapLogger = zaplog.L() | ||
|
||
// InitLogger initializes PD's logger. | ||
// InitLogger delegates to InitZapLogger. Keeping it here for historical reason. | ||
func InitLogger(cfg *LogConfig) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PD still depend on this method, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so, why not we retain InitLogger
and drop InitZapLogger
? An interface is better to be more abstract.
What problem does this PR solve?
The primary goal is to clean up the logging component. TiDB depends on two different third part log components, which are logrus and zap. This creates unnecessary complexity. In addition, there are some other logging flaws in code.
What is changed and how it works?
What's Changed:
pingcap/log
, which is based on zap.console
.Outside users should not perceive relevant changes.
Related changes
Check List
Tests
Release note