-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Ensure tctl
outputs all debug log messages
#12807
Conversation
tctl
outputs all debug log messages
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. As an alternative, we could set the configuration default logger to the global one (currently, we're creating a new logger), which would make more sense to me, since we're always going to set this.
That would equally make sense to me, but I wasn't too sure if that was going to start causing unexpected behaviour elsewhere (e.g intentionally silenced log messages start being output), so I went with this implementation as it felt a bit less risky with my current knowledge of the codebase. |
7fbbc06
to
6eb2de8
Compare
6eb2de8
to
b54ac22
Compare
b54ac22
to
5248eeb
Compare
@strideynet See the table below for backport results.
|
Closes #12801
Whilst
tctl
configures the global logger when-d
is provided, it previously injected autils.NewLogger()
into components which use thecfg.Log
field (as this is the default provided byservice.MakeDefaultConfig()
and this meant some debug log messages were not output. This change injectslogrus.StandardLogger()
into those components, so the configured log level/output rules take affect. See #12801 for an example of a log message that is not correctly output.An alternative implementation would be to instantiate a new logger, and configure it the same as
utils.InitLogger
configures it. I'm also open to this is you consider that preferable.