Use logger from logging pkg

This now also uses info as the default log level and enables the
configuration of the default log level as well as log levels of
the child loggers that will be implemented in a later commit.
This commit is contained in:
Ravi Kumar Kempapura Srinivasa 2021-09-20 13:46:13 +02:00 committed by Eric Lippmann
parent 414057830e
commit d3cdc8023b

View file

@ -3,6 +3,7 @@ package main
import (
"context"
"github.com/icinga/icingadb/internal/command"
"github.com/icinga/icingadb/internal/logging"
"github.com/icinga/icingadb/pkg/com"
"github.com/icinga/icingadb/pkg/common"
"github.com/icinga/icingadb/pkg/contracts"
@ -34,8 +35,15 @@ func main() {
func run() int {
cmd := command.New()
logs, err := logging.NewLogging(
cmd.Config.Logging.Level,
cmd.Config.Logging.Options,
)
if err != nil {
utils.Fatal(errors.Wrap(err, "can't configure logging"))
}
logger := cmd.Logger
logger := logs.GetLogger()
defer logger.Sync()
logger.Info("Starting Icinga DB")