3

In the AWS Amplify dashboard I can't see a way to access my /api/* route logs after deploying a hello world NextJS application. Where would these be located?

Steps:

  1. init extremely simple helloworld nextjs application with /api/hello.js export default (_, res) => res.send("hello world")
  2. Deploy to amplify
  3. /api/hello returns "hello world"

Can't find the logs for this lambda function nor find it anywhere in AWS or the Amplify dashboard. Even after enabling "Amplify Studio" I can't see it listed under 'Functions' but obviously I can call the endpoint without enabling Amplify Studio at all.

I can see a handler for /api/* in cloudfront distribution but can't find where the handler is.

2 Answers 2

5

Once is deployed with Amplify, go to the build page and look in the Deploy tab. You will find a row that says [INFO]: - API Lambda@Edge: xxxxxxx-xxxxxxx. The ID you see will be needed to identify the logs inside AWS CloudWatch.

The logs can be found going to CloudWatch -> Log groups and then you can find the API logs following this pattern: /aws/lambda/<region: this will probably be 'us-east-1'>.xxxxxxx-xxxxxxx

Sign up to request clarification or add additional context in comments.

2 Comments

Legend haven't verified but this looks like it would be correct
This answer is outdated. See @manncito's answer below.
2

Amplify now provides an easy shortcut to go straight to the cloudwatch logs:

  • Under app settings in amplify click monitoring
  • Then select the hosting compute logs tab
  • Then you will have a link for logs for each branch you have deployed

enter image description here

1 Comment

But I get The specific log group: /aws/amplify/d3n###### does not exist in this account or region.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.