mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
Add endpoints to provide ability to modify logging verbosity (#16111)
* add func to set level for specific logger * add endpoints to modify log level * initialize base logger with IndependentLevels * test to ensure other loggers remain unchanged * add DELETE loggers endpoints to revert back to config * add API docs page * add changelog entry * remove extraneous line * add log level field to Core struct * add godoc for getLogLevel * add some loggers to c.allLoggers
This commit is contained in:
@@ -460,8 +460,9 @@ func (c *ServerCommand) runRecoveryMode() int {
|
||||
}
|
||||
|
||||
c.logger = hclog.NewInterceptLogger(&hclog.LoggerOptions{
|
||||
Output: c.gatedWriter,
|
||||
Level: level,
|
||||
Output: c.gatedWriter,
|
||||
Level: level,
|
||||
IndependentLevels: true,
|
||||
// Note that if logFormat is either unspecified or standard, then
|
||||
// the resulting logger's format will be standard.
|
||||
JSONFormat: logFormat == logging.JSONFormat,
|
||||
@@ -592,6 +593,7 @@ func (c *ServerCommand) runRecoveryMode() int {
|
||||
Physical: backend,
|
||||
StorageType: config.Storage.Type,
|
||||
Seal: barrierSeal,
|
||||
LogLevel: logLevelString,
|
||||
Logger: c.logger,
|
||||
DisableMlock: config.DisableMlock,
|
||||
RecoveryMode: c.flagRecovery,
|
||||
@@ -1116,14 +1118,16 @@ func (c *ServerCommand) Run(args []string) int {
|
||||
|
||||
if c.flagDevThreeNode || c.flagDevFourCluster {
|
||||
c.logger = hclog.NewInterceptLogger(&hclog.LoggerOptions{
|
||||
Mutex: &sync.Mutex{},
|
||||
Output: c.gatedWriter,
|
||||
Level: hclog.Trace,
|
||||
Mutex: &sync.Mutex{},
|
||||
Output: c.gatedWriter,
|
||||
Level: hclog.Trace,
|
||||
IndependentLevels: true,
|
||||
})
|
||||
} else {
|
||||
c.logger = hclog.NewInterceptLogger(&hclog.LoggerOptions{
|
||||
Output: c.gatedWriter,
|
||||
Level: level,
|
||||
Output: c.gatedWriter,
|
||||
Level: level,
|
||||
IndependentLevels: true,
|
||||
// Note that if logFormat is either unspecified or standard, then
|
||||
// the resulting logger's format will be standard.
|
||||
JSONFormat: logFormat == logging.JSONFormat,
|
||||
|
||||
Reference in New Issue
Block a user