Add structure logging (Zap) to Vitess#13061
Add structure logging (Zap) to Vitess#13061EmadMokhtar wants to merge 4 commits intovitessio:mainfrom
Conversation
Signed-off-by: Emad Habib <ehabib@slack-corp.com>
Signed-off-by: Emad Habib <ehabib@slack-corp.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
This PR was closed because it has been stale for 7 days with no activity. |
There are files with the same name. I intend to keep the structure logging separated in a different file. |
|
This PR is being marked as stale because it has been open for 30 days with no activity. To rectify, you may do any of the following:
If no action is taken within 7 days, this PR will be closed. |
|
This PR was closed because it has been stale for 7 days with no activity. |
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
* Install zap log and noglog Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Implement the Vitess Structure Logger VTSLoger Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Move the structure logging code to logger.go file * make PR suggestions from vitessio#13061 Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict again Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix test Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * add flags e2e test for vtgateclienttest Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * update error msg Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> --------- Signed-off-by: Emad Habib <ehabib@slack-corp.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Emad Habib <ehabib@slack-corp.com> Co-authored-by: Emad Mokhtar <me@emadmokhtar.com>
* Install zap log and noglog Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Implement the Vitess Structure Logger VTSLoger Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Move the structure logging code to logger.go file * make PR suggestions from vitessio#13061 Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict again Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix test Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * add flags e2e test for vtgateclienttest Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * update error msg Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> --------- Signed-off-by: Emad Habib <ehabib@slack-corp.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Emad Habib <ehabib@slack-corp.com> Co-authored-by: Emad Mokhtar <me@emadmokhtar.com>
* `slack-19.0`: add structured logging (#449) * Install zap log and noglog Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Implement the Vitess Structure Logger VTSLoger Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Move the structure logging code to logger.go file * make PR suggestions from vitessio#13061 Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict again Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix test Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * add flags e2e test for vtgateclienttest Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * update error msg Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> --------- Signed-off-by: Emad Habib <ehabib@slack-corp.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Emad Habib <ehabib@slack-corp.com> Co-authored-by: Emad Mokhtar <me@emadmokhtar.com> * `slack-19.0`: fix structured logging (#532) * `slack-19.0`: fix structured logging Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * remove debug println Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * test cleanup Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * update flags and e2e tests Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix e2e flag test Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * code cleanup Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * simplify Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix goimports Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * log_dir WIP Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> --------- Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Add structured logging flags to RegisterFlagsWithTimeouts The cherry-picked structured logging commits added the flags to RegisterFlags() but not to RegisterFlagsWithTimeouts(). This caused mysqlctld (which uses RegisterFlagsWithTimeouts) to not have the structured logging flags available. This commit adds the --structured-logging and --structured-log-level flags to RegisterFlagsWithTimeouts() to match RegisterFlags(). Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> --------- Signed-off-by: Emad Habib <ehabib@slack-corp.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Emad Habib <ehabib@slack-corp.com> Co-authored-by: Emad Mokhtar <me@emadmokhtar.com> Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
* `slack-19.0`: add structured logging (#449) * Install zap log and noglog Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Implement the Vitess Structure Logger VTSLoger Signed-off-by: Emad Habib <ehabib@slack-corp.com> * Move the structure logging code to logger.go file * make PR suggestions from vitessio#13061 Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Fix bad merge conflict again Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix test Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * add flags e2e test for vtgateclienttest Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * update error msg Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> --------- Signed-off-by: Emad Habib <ehabib@slack-corp.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Emad Habib <ehabib@slack-corp.com> Co-authored-by: Emad Mokhtar <me@emadmokhtar.com> * `slack-19.0`: fix structured logging (#532) * `slack-19.0`: fix structured logging Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * remove debug println Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * test cleanup Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * update flags and e2e tests Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix e2e flag test Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * code cleanup Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * simplify Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * fix goimports Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * log_dir WIP Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> --------- Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * Add structured logging flags to RegisterFlagsWithTimeouts The cherry-picked structured logging commits added the flags to RegisterFlags() but not to RegisterFlagsWithTimeouts(). This caused mysqlctld (which uses RegisterFlagsWithTimeouts) to not have the structured logging flags available. This commit adds the --structured-logging and --structured-log-level flags to RegisterFlagsWithTimeouts() to match RegisterFlags(). Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com> --------- Signed-off-by: Emad Habib <ehabib@slack-corp.com> Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: Tanjin Xu <tanjin.xu@slack-corp.com> Co-authored-by: Tim Vaillancourt <tim@timvaillancourt.com> Co-authored-by: Emad Habib <ehabib@slack-corp.com> Co-authored-by: Emad Mokhtar <me@emadmokhtar.com> Co-authored-by: Claude <svc-devxp-claude@slack-corp.com>
Description
The goal of this PR is to introduce the structure logging to Vitess. Vitess is using
glogas logger. So I decided to usenoglogand create drop-in replacement. I used Zap log to replaceglog.The PR is also introducing a flag
structure_loggingwhere the user can choose to use structure logging or the default logging. The default value isFalseso the default is to use the current loggingglog.Related Issue(s)
#11613
Checklist
Deployment Notes