diff --git a/store/pkg/command/server.go b/store/pkg/command/server.go index a8677eb16..622719874 100644 --- a/store/pkg/command/server.go +++ b/store/pkg/command/server.go @@ -3,6 +3,10 @@ package command import ( "context" + gofig "github.com/gookit/config/v2" + ociscfg "github.com/owncloud/ocis/ocis-pkg/config" + "github.com/owncloud/ocis/ocis-pkg/shared" + "github.com/owncloud/ocis/store/pkg/tracing" "github.com/owncloud/ocis/ocis-pkg/sync" @@ -21,7 +25,26 @@ func Server(cfg *config.Config) *cli.Command { Name: "server", Usage: "Start integrated server", Before: func(ctx *cli.Context) error { - return ParseConfig(ctx, cfg) + // remember shared logging info to prevent empty overwrites + inLog := cfg.Log + if err := ParseConfig(ctx, cfg); err != nil { + return err + } + + if (cfg.Log == shared.Log{}) && (inLog != shared.Log{}) { + // set the default to the parent config + cfg.Log = inLog + + // and parse the environment + conf := &gofig.Config{} + conf.LoadOSEnv(config.GetEnv(), false) + bindings := config.StructMappings(cfg) + if err := ociscfg.BindEnv(conf, bindings); err != nil { + return err + } + } + + return nil }, Action: func(c *cli.Context) error { logger := NewLogger(cfg)