-
Notifications
You must be signed in to change notification settings - Fork 276
logs: make log level configurable through meshconfig #3650
Conversation
change to trace through kubectl edit meshconfig
reset to info through kubectl edit meshconfig
|
Codecov Report
@@ Coverage Diff @@
## main #3650 +/- ##
==========================================
+ Coverage 67.05% 67.17% +0.12%
==========================================
Files 179 180 +1
Lines 8705 8741 +36
==========================================
+ Hits 5837 5872 +35
+ Misses 2837 2836 -1
- Partials 31 33 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Lets back port this to v0.9 as well ?
cmd/osm-controller/osm-controller.go
Outdated
log.Info().Msgf("Global log level changed to: %s", logLevel) | ||
currentLogLevel = logLevel | ||
} |
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.
nit: seems unnecessary to log this because we would otherwise see an error.
New `osmLogLevel` option has been added under observability meshconfig spec (seems the most related and relevant to the available categories) to allow changing the log level of OSM at runtime. The initial log level flag has been kept at it still mandates boot log level up to the point configurator and the log level handler are both up, which then meshconfig value takes over. The handler can't be easilly moved to the `logger` package as it introduces a hard dependency cycle between logger<->configurator, hence the handler has been left on osm-controller main. Adds a unit test, and see below a working example on a running deployment. Fixes openservicemesh#3646 Signed-off-by: Eduard Serra <[email protected]>
@Mergifyio backport release-v0.9 |
Command
|
New
osmLogLevel
option has been added under observability meshconfigspec (seems the most related and relevant to the available categories)
to allow changing the log level of OSM at runtime.
The initial log level flag has been kept as it still mandates boot log
level up to the point configurator and the log level handler are both
up, which then meshconfig value takes over.
The handler can't be easilly moved to the
logger
package as itintroduces a hard dependency cycle between logger<->configurator, hence
the handler has been left on osm-controller main.
Adds a unit test, and see below a working example on a running deployment.
Fixes #3646
Signed-off-by: Eduard Serra [email protected]
Description:
Affected area:
Please answer the following questions with yes/no.
Does this change contain code from or inspired by another project?
Is this a breaking change?