-
Notifications
You must be signed in to change notification settings - Fork 188
log: support change the level of etcd for debugging #992
Conversation
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.
rest LGTM
logger := log.L().WithFields(zap.String("component", "embed etcd")) | ||
// if logLevel is info, set etcd log level to WARN to reduce log | ||
if strings.ToLower(logLevel) == "info" { | ||
logger.Logger = logger.WithOptions(zap.IncreaseLevel(zap.WarnLevel)) |
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.
let's log this change to tell user. and "debug" maybe a level lower than "info"
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.
add log in 6d12af4
user can use debug level to see more log about etcd.
logger.Logger = logger.WithOptions(zap.IncreaseLevel(zap.WarnLevel)) | ||
} | ||
|
||
cfg.ZapLoggerBuilder = embed.NewZapCoreLoggerBuilder(logger.Logger, logger.Core(), log.Props().Syncer) // use global app props. |
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.
not sure why change logger
to logger.Logger
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.
type of logger now is log.Logger after
Line 451 in 7de7bb4
logger := log.L().WithFields(zap.String("component", "embed etcd")).WithOptions(zap.IncreaseLevel(zap.ErrorLevel)) |
LGTM |
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
cherry pick to release-2.0 in PR #995 |
What problem does this PR solve?
close #974
What is changed and how it works?
warn
if log-level isinfo
, otherwise set it same as log-levelCheck List
Tests
Manually check the log file.