-
Notifications
You must be signed in to change notification settings - Fork 695
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
Please Make Event Logging Verbosity Configurable #1285
Comments
hi @shin-go, As you said, our Log library has limitations. We can not set up right now the debug level of our messages. We are using the standard Golang log library and can not set up this level. One option here is to move to another log library like Zap to make it possible or to improve our actual log library. This will be an excellent contribution for the project. I invite you to collaborate to the project, helping us to improve this log process. Thanks a lot Álvaro |
@alvneiayu I would like to work on this issue, I agree on using Zap for better logging, but before I start on that I just wanted to make sure that Zap is the option we will go with |
thanks a lot for your proposal. It would be nice to work on this issue, so feel free to contribute with. About to use Zap or not, recently a native structure logging library has been released: Maybe it is a good idea to investigate it and use it to reduce the dependencies needed. Thanks a lot again Álvaro |
**Description of the change** Change controller logging to use `log/slog`. **Benefits** 1. Allow structured logging. 2. Allow changing logging format between text and JSON. 3. Allow changing logging level. **Possible drawbacks** N/A **Applicable issues** - fixes #1285 **Additional information** * I took the liberty of removing log at line 91 in pkg/controller/main.go as it only served as a separator * To implement the functionality of `--log-info-to-stdout`, I had to implement a custom handler that would hand logs down to one of two slog.Loggers in place of the package in `pkg/log` that handled this previously --------- Signed-off-by: M Essam Hamed <github@messam.xyz>
Which component:
controller
Is your feature request related to a problem? Please describe.
Unless it's tucked away someplace not obvious in documentation, it doesn't look like there is an
arg
that can be set on the Deployment template spec nor in the helm chart. This would be greatly appreciated as the controller can be extremely chatty when it iterates on decrypting SealedSecret resources, particularly in large Kubernetes clusters.Such normal events would be considered INFO, which are usually not very interesting for day-to-day knowledge when you may instead be interested specifically in WARN or more severe.
Here's an example event log from the controller:
And worse, some events that aren't timestamped. #1274 is a good example of this.
Describe the solution you'd like
A flag that can be set in
args
on the Deployment template spec and helm chart. Also if implemented please document clearly what the valid values are. Some tools abide by the native Kubernetes logging verbosities which are integers (0 = shut up, 1 = info, etc.) while others support logging verbosity but only note the flag expects a string type.Describe alternatives you've considered
Are there any?
Additional context
This might take more effort to implement because none of the events produced by the controller are classified classically - e.g.:
INFO
,DEBUG
,WARN
, etc..The text was updated successfully, but these errors were encountered: