mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
Backport of fix log_requests_level misconfiguration into release/1.15.x (#24059)
* backport of commit 0f5f648c1c
* changelog
---------
Co-authored-by: Peter Wilson <peter.wilson@hashicorp.com>
This commit is contained in:
committed by
GitHub
parent
cf1b5cafa0
commit
f921f720a9
3
changelog/24059.txt
Normal file
3
changelog/24059.txt
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
```release-note:bug
|
||||||
|
core/config: Use correct HCL config value when configuring `log_requests_level`.
|
||||||
|
```
|
||||||
@@ -1249,8 +1249,8 @@ func NewCore(conf *CoreConfig) (*Core, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Log level
|
// Log requests level
|
||||||
c.configureLogRequestLevel(conf.RawConfig.LogLevel)
|
c.configureLogRequestsLevel(conf.RawConfig.LogRequestsLevel)
|
||||||
|
|
||||||
// Quotas
|
// Quotas
|
||||||
quotasLogger := conf.Logger.Named("quotas")
|
quotasLogger := conf.Logger.Named("quotas")
|
||||||
@@ -1306,8 +1306,8 @@ func (c *Core) configureListeners(conf *CoreConfig) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// configureLogRequestLevel configures the Core with the supplied log level.
|
// configureLogRequestsLevel configures the Core with the supplied log requests level.
|
||||||
func (c *Core) configureLogRequestLevel(level string) {
|
func (c *Core) configureLogRequestsLevel(level string) {
|
||||||
c.logRequestsLevel = uberAtomic.NewInt32(0)
|
c.logRequestsLevel = uberAtomic.NewInt32(0)
|
||||||
|
|
||||||
lvl := log.LevelFromString(level)
|
lvl := log.LevelFromString(level)
|
||||||
|
|||||||
@@ -254,12 +254,12 @@ func TestNewCore_configureLogRequestLevel(t *testing.T) {
|
|||||||
t.Run(name, func(t *testing.T) {
|
t.Run(name, func(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
// We need to supply a logger, as configureLogRequestLevel emits
|
// We need to supply a logger, as configureLogRequestsLevel emits
|
||||||
// warnings to the logs in certain circumstances.
|
// warnings to the logs in certain circumstances.
|
||||||
core := &Core{
|
core := &Core{
|
||||||
logger: corehelpers.NewTestLogger(t),
|
logger: corehelpers.NewTestLogger(t),
|
||||||
}
|
}
|
||||||
core.configureLogRequestLevel(tc.level)
|
core.configureLogRequestsLevel(tc.level)
|
||||||
require.Equal(t, tc.expectedLevel, log.Level(core.logRequestsLevel.Load()))
|
require.Equal(t, tc.expectedLevel, log.Level(core.logRequestsLevel.Load()))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user