Commit 3b361028 authored by Tomasz Maczukin's avatar Tomasz Maczukin 🌴

Respect configured log format and level when system logging is used

parent f92380ce
......@@ -43,12 +43,11 @@ func (s *ServiceLogHook) Fire(entry *logrus.Entry) error {
}
func SetSystemLogger(svc service.Service) {
logrus.SetFormatter(new(logrus.TextFormatter))
logger, err := svc.SystemLogger(nil)
if err == nil {
logrus.AddHook(&ServiceLogHook{logger, logrus.InfoLevel})
logrus.AddHook(&ServiceLogHook{logger, logrus.GetLevel()})
} else {
logrus.Errorln(err)
logrus.WithError(err).Error("Error while setting up the system logger")
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment