Which solution will meet this requirement?
A developer is writing an AWS Lambda function. The developer wants to log key events that occur while the Lambda function runs. The developer wants to include a unique identifier to associate the events with a specific function invocation.
The developer adds the following code to the Lambda function:
Which solution will meet this requirement?
A . Obtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to standard output.
B . Obtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to a file.
C . Obtain the request identifier from the AWS request ID field in the event object. Configure the application to write logs to standard output.
D . Obtain the request identifier from the AWS request ID field in the context object. Configure the application to write logs to a file.
Answer: A
Explanation:
https://docs.aws.amazon.com/lambda/latest/dg/nodejs-context.html
https://docs.aws.amazon.com/lambda/latest/dg/nodejs-logging.html
There is no explicit information for the runtime, the code is written in Node.js.
AWS Lambda is a service that lets developers run code without provisioning or managing servers.
The developer can use the AWS request ID field in the context object to obtain a unique identifier for each function invocation. The developer can configure the application to write logs to standard output, which will be captured by Amazon CloudWatch Logs. This solution will meet the requirement of logging key events with a unique identifier.
Reference: [What Is AWS Lambda? – AWS Lambda]
[AWS Lambda Function Handler in Node.js – AWS Lambda] [Using Amazon CloudWatch – AWS Lambda]
Latest DVA-C02 Dumps Valid Version with 65 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund