-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add structured logging (first version) (#254)
* Introduce new functions to log verbose or on info, use internally the old verbosity flags * allows simplifying certain code parts * add zerolog for structured json logging (https://betterprogramming.pub/how-to-use-structured-json-logging-in-golang-applications-7fc5e2751dbd) * add new flag to toggle structured logging for cli * useful when running worker Future: Worker can add variables to the logger, like experiment name etc. ---- Example: With json logging ``` $ ./zbchaos restart broker -v --jsonLogging {"level":"debug","cli":"zbchaos","time":"2022-11-23T10:58:07+01:00","message":"Connecting to zell-chaos"} {"level":"debug","cli":"zbchaos","time":"2022-11-23T10:58:07+01:00","message":"Running experiment in self-managed environment."} {"level":"debug","cli":"zbchaos","time":"2022-11-23T10:58:07+01:00","message":"Successfully created port forwarding tunnel"} {"level":"debug","cli":"zbchaos","time":"2022-11-23T10:58:07+01:00","message":"Found Broker zell-chaos-zeebe-1 as LEADER for partition 1."} {"level":"debug","cli":"zbchaos","time":"2022-11-23T10:58:07+01:00","message":"Restarted zell-chaos-zeebe-1"} ``` Normal: ``` $ ./zbchaos restart broker -v Connecting to zell-chaos Running experiment in self-managed environment. Successfully created port forwarding tunnel Found Broker zell-chaos-zeebe-0 as LEADER for partition 1. Restarted zell-chaos-zeebe-0 ```
- Loading branch information
Showing
28 changed files
with
156 additions
and
147 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.