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:
Jens Langhammer 2022-04-03 13:23:55 +02:00
parent 37db6764ab
commit b46eb7198b
1 changed files with 5 additions and 1 deletions

View File

@ -16,8 +16,12 @@ import (
func doGlobalSetup(outpost api.Outpost, globalConfig api.Config) {
l := log.WithField("logger", "authentik.outpost")
m := outpost.Managed.Get()
level, ok := outpost.Config[ConfigLogLevel]
if !ok {
level = "info"
}
if m == nil || *m == "" {
switch outpost.Config[ConfigLogLevel].(string) {
switch level.(string) {
case "trace":
log.SetLevel(log.TraceLevel)
case "debug":