-
Notifications
You must be signed in to change notification settings - Fork 328
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
tetra: Added dynamic log level change option #2643
base: main
Are you sure you want to change the base?
tetra: Added dynamic log level change option #2643
Conversation
Added a tetra loglevel subcommand which allows one to dynamically change Tetragon's log level without restarting it. Signed-off-by: Philip Schmid <[email protected]>
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
} | ||
|
||
// Temporarily set the logger to the lowest level to ensure the message is logged | ||
logger.SetLogLevel(logrus.TraceLevel) |
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.
Will this impact other routines also using logger here? I'm not sure about internals of logging but we wouldn't want to shortly spew debug/trace info if another sensor is running.
Why not just make it a Warn if its critical to have printed? Seems cleaner than bouncing loglevel around.
} | ||
|
||
func (s *Server) ResetLogLevel(ctx context.Context, req *tetragon.ResetLogLevelRequest) (*tetragon.ResetLogLevelResponse, error) { | ||
// TODO: Get the original log level with which Tetragon was originally started with in a nicer way than via "option.Config.LogOpts["level"]". |
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.
I would either drop the todo and create a first issue or do this ;)
Like the idea started reviewing before I noticed it was draft. But would be a good addition thanks for working on it. |
Added a tetra loglevel subcommand which allows one to dynamically change Tetragon's log level without restarting it.
Supported subcommands:
get Prints the current log level reset Reset the log level to the value Tetragon was started with set Set the log level
Fixes: #2545