From 4d79e76c2d3ed51e8222fb2e7fbd48110f1a4c9b Mon Sep 17 00:00:00 2001 From: Yury Frolov Date: Fri, 22 Dec 2023 18:11:50 +0500 Subject: [PATCH] Fix logging --- config/instance.go | 1 + pkg/core/core.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/config/instance.go b/config/instance.go index 9850d77..8d0f3ea 100644 --- a/config/instance.go +++ b/config/instance.go @@ -18,6 +18,7 @@ type Instance struct { CryptoCnf Crypto `json:"crypto" toml:"crypto" yaml:"crypto"` LogPath string `json:"log_path" toml:"log_path" yaml:"log_path"` + LogLevel string `json:"log_level" toml:"log_level" yaml:"log_level"` SocketPath string `json:"socket_path" toml:"socket_path" yaml:"socket_path"` SystemdNotificationsDebug bool `json:"sd_notifications_debug" toml:"sd_notifications_debug" yaml:"sd_notifications_debug"` diff --git a/pkg/core/core.go b/pkg/core/core.go index c22da0f..300830f 100644 --- a/pkg/core/core.go +++ b/pkg/core/core.go @@ -23,6 +23,9 @@ type Instance struct { func (i *Instance) Run(instanceCnf *config.Instance) error { + ylogger.ReloadLogger(instanceCnf.LogPath) + ylogger.UpdateZeroLogLevel(instanceCnf.LogLevel) + sigs := make(chan os.Signal, 1) signal.Notify(sigs, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR1, syscall.SIGUSR2)