From e0f2fe3769f793d6bfb1f1f4a6768a754f9e75bc Mon Sep 17 00:00:00 2001 From: Pozueco Adrian Date: Thu, 8 Jul 2021 09:13:49 +0200 Subject: [PATCH] Fix context event.eventParams --- logger/logger.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/logger/logger.go b/logger/logger.go index a6b8e7a..0df3a9d 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -1,6 +1,7 @@ package logger import ( + "encoding/json" "github.com/Ryanair/gofrlib/log" "github.com/aws/aws-lambda-go/events" ) @@ -69,7 +70,9 @@ func SetEvent(source string, body string, params map[string]string) { func SetSQSEvent(event events.SQSMessage) { log.With("Body.context.origin.event.eventSource", event.EventSource) log.With("Body.context.origin.event.eventBody", event.Body) - log.With("Body.context.origin.event.eventParams", event.Attributes) + + raw, _ := json.Marshal(event.Attributes) + log.With("Body.context.origin.event.eventParams", string(raw)) } func SetApigwRequest(event events.APIGatewayV2HTTPRequest) {