From c7162e5de1ceabb51db60df1c649cc264a1272cc Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Mon, 8 Apr 2024 14:34:18 +0200 Subject: [PATCH] Register mysql default logger prior to 'mysql#NewConfig()' --- pkg/config/database.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/config/database.go b/pkg/config/database.go index a541d5c9c..0895d26c9 100644 --- a/pkg/config/database.go +++ b/pkg/config/database.go @@ -42,6 +42,7 @@ func (d *Database) Open(logger *logging.Logger) (*icingadb.DB, error) { config.User = d.User config.Passwd = d.Password + config.Logger = icingadb.MysqlFuncLogger(logger.Debug) if d.isUnixAddr() { config.Net = "unix" @@ -71,8 +72,6 @@ func (d *Database) Open(logger *logging.Logger) (*icingadb.DB, error) { } } - _ = mysql.SetLogger(icingadb.MysqlFuncLogger(logger.Debug)) - c, err := mysql.NewConnector(config) if err != nil { return nil, errors.Wrap(err, "can't open mysql database")