internal: handle log level not being set in config
closes #2650 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
37db6764ab
commit
b46eb7198b
|
@ -16,8 +16,12 @@ import (
|
||||||
func doGlobalSetup(outpost api.Outpost, globalConfig api.Config) {
|
func doGlobalSetup(outpost api.Outpost, globalConfig api.Config) {
|
||||||
l := log.WithField("logger", "authentik.outpost")
|
l := log.WithField("logger", "authentik.outpost")
|
||||||
m := outpost.Managed.Get()
|
m := outpost.Managed.Get()
|
||||||
|
level, ok := outpost.Config[ConfigLogLevel]
|
||||||
|
if !ok {
|
||||||
|
level = "info"
|
||||||
|
}
|
||||||
if m == nil || *m == "" {
|
if m == nil || *m == "" {
|
||||||
switch outpost.Config[ConfigLogLevel].(string) {
|
switch level.(string) {
|
||||||
case "trace":
|
case "trace":
|
||||||
log.SetLevel(log.TraceLevel)
|
log.SetLevel(log.TraceLevel)
|
||||||
case "debug":
|
case "debug":
|
||||||
|
|
Reference in New Issue