1 個回答
- 最新
- 最多得票
- 最多評論
0
The lambda function context has a unique awsRequestId, that you can use to uniquely identify every invocation of a lambda function. By default, lambda generated logs have the Request ID, but you can also get it from the context object and add it to every log statement in your own lambda code - https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html
Also take a look at this blog about logging when using Lambda with API Gateway - https://aws.amazon.com/blogs/compute/techniques-and-tools-for-better-serverless-api-logging-with-amazon-api-gateway-and-aws-lambda/
相關內容
- 已提問 6 個月前
- AWS 官方已更新 3 年前
- AWS 官方已更新 2 年前
- AWS 官方已更新 1 年前
- AWS 官方已更新 1 年前
I would also look at using Lambda Power Tools, which helps you in writing logs according to the best practices.