diff --git a/pkg/app/log.go b/pkg/app/log.go index b96489db..5869e039 100644 --- a/pkg/app/log.go +++ b/pkg/app/log.go @@ -65,7 +65,6 @@ func SetupLogging(runtimeConfig *config.Config, logger *unilogger.Logger) { // log.SetFormatter(&ProxyJsonWrapperFormatter{WrappedFormatter: formatter}) // } - logger.SetLevel(unilogger.LogLevelFromStr(LogLevel)) unilogger.SetDefaultLevel(unilogger.LogLevelFromStr(LogLevel)) runtimeConfig.Register("log.level", @@ -73,7 +72,6 @@ func SetupLogging(runtimeConfig *config.Config, logger *unilogger.Logger) { strings.ToLower(LogLevel), func(oldValue string, newValue string) error { log.Infof("Set log level to '%s'", newValue) - logger.SetLevel(unilogger.LogLevelFromStr(newValue)) unilogger.SetDefaultLevel(unilogger.LogLevelFromStr(LogLevel)) return nil }, func(oldValue string, newValue string) time.Duration { diff --git a/pkg/shell-operator/bootstrap.go b/pkg/shell-operator/bootstrap.go index 575b3f15..100dbb92 100644 --- a/pkg/shell-operator/bootstrap.go +++ b/pkg/shell-operator/bootstrap.go @@ -161,9 +161,10 @@ func (op *ShellOperator) SetupEventManagers() { // Initialize events handler that emit tasks to run hooks cfg := &managerEventsHandlerConfig{ - tqs: op.TaskQueues, - mgr: op.KubeEventsManager, - smgr: op.ScheduleManager, + tqs: op.TaskQueues, + mgr: op.KubeEventsManager, + smgr: op.ScheduleManager, + logger: op.logger.Named("manager-events-handler"), } op.ManagerEventsHandler = newManagerEventsHandler(op.ctx, cfg) } diff --git a/pkg/shell-operator/manager_events_handler.go b/pkg/shell-operator/manager_events_handler.go index a35fa254..f743ed9b 100644 --- a/pkg/shell-operator/manager_events_handler.go +++ b/pkg/shell-operator/manager_events_handler.go @@ -18,7 +18,7 @@ type managerEventsHandlerConfig struct { mgr kube_events_manager.KubeEventsManager smgr schedule_manager.ScheduleManager - Logger *unilogger.Logger + logger *unilogger.Logger } type ManagerEventsHandler struct { @@ -48,7 +48,7 @@ func newManagerEventsHandler(ctx context.Context, cfg *managerEventsHandlerConfi scheduleManager: cfg.smgr, kubeEventsManager: cfg.mgr, taskQueues: cfg.tqs, - logger: cfg.Logger, + logger: cfg.logger, } }