diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index fc9554661a..3f0ca72a1e 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -370,6 +370,7 @@ func initLocalStorage(c *cfg) { c.cfgObject.metastorage = meta.NewDB( meta.FromBoltDB(boltDB), + meta.WithLogger(c.log), ) } diff --git a/pkg/local_object_storage/metabase/db.go b/pkg/local_object_storage/metabase/db.go index 56780a595f..46f73587c1 100644 --- a/pkg/local_object_storage/metabase/db.go +++ b/pkg/local_object_storage/metabase/db.go @@ -3,7 +3,9 @@ package meta import ( "github.com/nspcc-dev/neofs-api-go/pkg/object" v2object "github.com/nspcc-dev/neofs-api-go/v2/object" + "github.com/nspcc-dev/neofs-node/pkg/util/logger" "go.etcd.io/bbolt" + "go.uber.org/zap" ) // DB represents local metabase of storage node. @@ -20,10 +22,14 @@ type Option func(*cfg) type cfg struct { boltDB *bbolt.DB + + log *logger.Logger } func defaultCfg() *cfg { - return &cfg{} + return &cfg{ + log: zap.L(), + } } // NewDB creates, initializes and returns DB instance. @@ -70,3 +76,10 @@ func FromBoltDB(db *bbolt.DB) Option { c.boltDB = db } } + +// WithLogger returns option to set logger of DB. +func WithLogger(l *logger.Logger) Option { + return func(c *cfg) { + c.log = l + } +}