[英]Amplify - NextJS - Access lambda logs
In the AWS Amplify dashboard I can't see a way to access my /api/* route logs after deploying a hello world NextJS application.在 AWS Amplify 控制面板中,我看不到在部署 hello world NextJS 应用程序后访问我的 /api/* 路由日志的方法。 Where would these be located?这些将位于何处?
Steps:脚步:
export default (_, res) => res.send("hello world")
使用 /api/hello.js 初始化极其简单的 helloworld nextjs 应用程序export default (_, res) => res.send("hello world")
Can't find the logs for this lambda function nor find it anywhere in AWS or the Amplify dashboard.无法找到此 lambda function 的日志,也无法在 AWS 或 Amplify 控制面板中的任何位置找到它。 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.即使在启用“Amplify Studio”之后,我也看不到它列在“功能”下,但显然我可以在根本不启用 Amplify Studio 的情况下调用端点。
I can see a handler for /api/* in cloudfront distribution but can't find where the handler is.我可以在云端分发中看到 /api/* 的处理程序,但找不到处理程序的位置。
Once is deployed with Amplify, go to the build page and look in the Deploy
tab.使用 Amplify 部署后,go 到构建页面并查看Deploy
选项卡。 You will find a row that says [INFO]: - API Lambda@Edge: xxxxxxx-xxxxxxx
.您会发现一行显示[INFO]: - API Lambda@Edge: xxxxxxx-xxxxxxx
。 The ID you see will be needed to identify the logs inside AWS CloudWatch
.将需要您看到的 ID 来识别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
可以在CloudWatch
-> Log groups
中找到日志,然后您可以按照以下模式找到 API 日志: /aws/lambda/<region: this will probably be 'us-east-1'>.xxxxxxx-xxxxxxx
Amplify now provides an easy shortcut to go straight to the cloudwatch logs: Amplify 现在提供了一个简单的快捷方式,可以直接通过 go 访问 cloudwatch 日志:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.