@@ -12,6 +12,7 @@ import (
1212 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1313 "sigs.k8s.io/yaml"
1414
15+ "github.com/flanksource/commons/logger"
1516 "github.com/flanksource/duty/context"
1617 "github.com/flanksource/duty/shutdown"
1718 "github.com/flanksource/gomplate/v3"
@@ -42,7 +43,8 @@ func pretty(o any) string {
4243}
4344func RunConsumer (rootCtx context.Context , config Config ) error {
4445 if config .LogLevel != "" {
45- rootCtx .Logger .SetLogLevel (config .LogLevel )
46+ logger .StandardLogger ().SetLogLevel (config .LogLevel )
47+ rootCtx .Infof ("Set log level to %s => %v" , config .LogLevel , rootCtx .Logger .GetLevel ())
4648 }
4749
4850 if config .client == nil {
@@ -82,6 +84,7 @@ func RunConsumer(rootCtx context.Context, config Config) error {
8284 }
8385
8486 ctx := rootCtx .WithName (msg .LoggableID )
87+ ctx .Logger .SetLogLevel (config .LogLevel )
8588
8689 // Attempt to decode Bas64
8790 decoded , err := base64 .StdEncoding .DecodeString (string (msg .Body ))
@@ -99,7 +102,7 @@ func RunConsumer(rootCtx context.Context, config Config) error {
99102 data ["_id" ] = msg .LoggableID
100103 data ["_metadata" ] = msg .Metadata
101104
102- ctx .Debugf ("Received message: %+v" , pretty (data ))
105+ ctx .Debugf ("Received message:\n %+v" , pretty (data ))
103106
104107 templater := gomplate.StructTemplater {
105108 Values : data ,
0 commit comments