From 2eea2ad9081d2db4b68af6c0492682d62faabfe5 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Mon, 11 Jan 2021 13:36:56 +0100 Subject: [PATCH] Use debug logger when ACTIONLOG_DEBUG=true --- compose/service/service.go | 3 ++- federation/service/service.go | 3 ++- messaging/service/service.go | 3 ++- system/service/service.go | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/compose/service/service.go b/compose/service/service.go index 22fbb9344e..60135b88d6 100644 --- a/compose/service/service.go +++ b/compose/service/service.go @@ -3,6 +3,7 @@ package service import ( "context" "fmt" + "github.com/cortezaproject/corteza-server/pkg/logger" "strconv" "time" @@ -93,7 +94,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config) policy = actionlog.MakeDisabledPolicy() } else if c.ActionLog.Debug { policy = actionlog.MakeDebugPolicy() - tee = log + tee = logger.MakeDebugLogger() } DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy) diff --git a/federation/service/service.go b/federation/service/service.go index 4a481ecaee..df683735e8 100644 --- a/federation/service/service.go +++ b/federation/service/service.go @@ -2,6 +2,7 @@ package service import ( "context" + "github.com/cortezaproject/corteza-server/pkg/logger" "time" cs "github.com/cortezaproject/corteza-server/compose/service" @@ -77,7 +78,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config) policy = actionlog.MakeDisabledPolicy() } else if c.ActionLog.Debug { policy = actionlog.MakeDebugPolicy() - tee = log + tee = logger.MakeDebugLogger() } DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy) diff --git a/messaging/service/service.go b/messaging/service/service.go index 48d4111432..609363993d 100644 --- a/messaging/service/service.go +++ b/messaging/service/service.go @@ -2,6 +2,7 @@ package service import ( "context" + "github.com/cortezaproject/corteza-server/pkg/logger" "time" "github.com/cortezaproject/corteza-server/pkg/actionlog" @@ -83,7 +84,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config) policy = actionlog.MakeDisabledPolicy() } else if c.ActionLog.Debug { policy = actionlog.MakeDebugPolicy() - tee = log + tee = logger.MakeDebugLogger() } DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy) diff --git a/system/service/service.go b/system/service/service.go index 38aecf4156..a4f91bf237 100644 --- a/system/service/service.go +++ b/system/service/service.go @@ -3,6 +3,7 @@ package service import ( "context" "errors" + "github.com/cortezaproject/corteza-server/pkg/logger" "time" "github.com/cortezaproject/corteza-server/pkg/actionlog" @@ -119,7 +120,7 @@ func Initialize(ctx context.Context, log *zap.Logger, s store.Storer, c Config) policy = actionlog.MakeDisabledPolicy() } else if c.ActionLog.Debug { policy = actionlog.MakeDebugPolicy() - tee = log + tee = logger.MakeDebugLogger() } DefaultActionlog = actionlog.NewService(DefaultStore, log, tee, policy)