From 0334a9afe855d2fba0160b35ecddcc21db8238ef Mon Sep 17 00:00:00 2001 From: Laurence Jones Date: Tue, 8 Aug 2023 13:38:11 +0100 Subject: [PATCH] Add method name to child logger so we can see which function is erroring when in enrichers (#2411) --- pkg/parser/runtime.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/parser/runtime.go b/pkg/parser/runtime.go index 6f957e7a2..ecc1b4d85 100644 --- a/pkg/parser/runtime.go +++ b/pkg/parser/runtime.go @@ -152,7 +152,7 @@ func (n *Node) ProcessStatics(statics []ExtraField, event *types.Event) error { /*still way too hackish, but : inject all the results in enriched, and */ if enricherPlugin, ok := n.EnrichFunctions.Registered[static.Method]; ok { clog.Tracef("Found method '%s'", static.Method) - ret, err := enricherPlugin.EnrichFunc(value, event, enricherPlugin.Ctx, n.Logger) + ret, err := enricherPlugin.EnrichFunc(value, event, enricherPlugin.Ctx, n.Logger.WithField("method", static.Method)) if err != nil { clog.Errorf("method '%s' returned an error : %v", static.Method, err) }