From 6af1fd61a7f941ebfd783d60da07c0c6a018c895 Mon Sep 17 00:00:00 2001 From: Evren Guden Date: Thu, 4 Jul 2024 16:06:24 +0300 Subject: [PATCH] [DEV-5758] Log product feature --- key/key.go | 2 ++ zap/wrapper.go | 1 + 2 files changed, 3 insertions(+) diff --git a/key/key.go b/key/key.go index d13a0c7..308bf6f 100644 --- a/key/key.go +++ b/key/key.go @@ -16,6 +16,7 @@ const ( User = "user" CorrelationID = "correlation_id" Tool = "tool" + ProductFeature = "product_feature" ) type ctxKey int @@ -25,4 +26,5 @@ const ( CtxCompany CtxCorrelationID CtxTool + CtxProductFeature ) diff --git a/zap/wrapper.go b/zap/wrapper.go index 6578c77..2084f3f 100644 --- a/zap/wrapper.go +++ b/zap/wrapper.go @@ -27,6 +27,7 @@ func (w *Logger) With(ctx context.Context, keysAndValues ...any) logi.Logger { addNotEmpty(key.CompanyKey, ctx.Value(key.CtxCompany)) addNotEmpty(key.CorrelationID, ctx.Value(key.CtxCorrelationID)) addNotEmpty(key.Tool, ctx.Value(key.CtxTool)) + addNotEmpty(key.ProductFeature, ctx.Value(key.CtxProductFeature)) } fields = append(fields, keysAndValues...)