Create a distinct log section in config

This commit is contained in:
Igor Perepilitsyn 2022-09-11 21:37:23 +02:00
parent 7247302f45
commit dd155dca97
9 changed files with 62 additions and 26 deletions

View file

@ -47,7 +47,7 @@ func initConfig() {
machineOutput := HasMachineOutputFlag()
zerolog.SetGlobalLevel(cfg.LogLevel)
zerolog.SetGlobalLevel(cfg.Log.Level)
// If the user has requested a "machine" readable format,
// then disable login so the output remains valid.
@ -55,7 +55,7 @@ func initConfig() {
zerolog.SetGlobalLevel(zerolog.Disabled)
}
if cfg.JSONLogs {
if cfg.Log.Format == headscale.JSONLogFormat {
log.Logger = log.Output(os.Stdout)
}