0

I use a AWS Lambda Python behind a SQS via an SQS event. How to log SQS event (input) when AWS Lambda timeout?

actualy, I have my SQS event body in my SQS dead letter queue but I do not have any ERROR log in cloudwatch.

Stéphane GRILLON
  • 11,140
  • 10
  • 85
  • 154
  • 3
    Your cloudwatch logs for that lambda contain a `Task timed out` log entry. *"How to log [anything] when AWS Lambda timeout?"* - you don't. When your lambda times out you cannot do anything anymore. If you want to gracefully handle that you need to write your lambda in a way that it is aware of its own timeout, and e.g. 0.5s before it would timeout it logs something. But then you cannot be sure that it actually timeouts, maybe it finishes 0.1s after that log message and therefore 0.4s before the timeout. What exactly are you trying to achieve and why? – luk2302 Jun 12 '23 at 08:19

0 Answers0