From 99669c205af6a2ab9564d5153800b2f0a65cb14e Mon Sep 17 00:00:00 2001 From: Neoman Nouiouat Date: Wed, 14 Dec 2022 01:13:33 -0800 Subject: [PATCH] Log exceptions processing messages as occur (#1011) This should help make debugging issues easier when investigating issues processing messages and provide more precise time of exception in logs. --- .../java/software/amazon/lambda/powertools/sqs/SqsUtils.java | 1 + 1 file changed, 1 insertion(+) diff --git a/powertools-sqs/src/main/java/software/amazon/lambda/powertools/sqs/SqsUtils.java b/powertools-sqs/src/main/java/software/amazon/lambda/powertools/sqs/SqsUtils.java index e8bf9a7ae..9ae81b77d 100644 --- a/powertools-sqs/src/main/java/software/amazon/lambda/powertools/sqs/SqsUtils.java +++ b/powertools-sqs/src/main/java/software/amazon/lambda/powertools/sqs/SqsUtils.java @@ -497,6 +497,7 @@ public static List batchProcessor(final SQSEvent event, batchContext.addSuccess(message); } catch (Exception e) { batchContext.addFailure(message, e); + LOG.error("Encountered issue processing message: {}", message.getMessageId(), e); } }