您如何看待Amazon Lambda函数的console.log输出 [英] How do you look at console.log output of the amazon lambda function

查看:332
本文介绍了您如何看待Amazon Lambda函数的console.log输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您进行

console.log('Loading function');

在Amazon Lambda函数中,该去哪里?

in an amazon lambda function, where does that go?

我的设置 api网关 lambda函数nodejs6.10 curl https://n2tredacted.execute-api.us-east- 1.amazonaws.com/prod/redactedFunc

My setup api gateway lambda function nodejs6.10 curl https://n2tredacted.execute-api.us-east-1.amazonaws.com/prod/redactedFunc

推荐答案

AWS Lambda日志写入 CloudWatch日志.这是如何访问它们:

AWS Lambda logs are written to CloudWatch Logs. Here's how to access them:

  1. 在AWS控制台中选择Lambda函数
  2. 点击监控"标签
  3. 在CloudWatch中选择查看日志

如果您希望在AWS控制台之外检索CloudWatch Logs,则有许多CLI选项:

If you prefer to retrieve CloudWatch Logs outside of the AWS Console, then there are numerous CLI options:

  • awscli: aws logs get-log-events
  • github: jorgebastida/awslogs
  • github: TylerBrock/saw
  • serverless: sls logs (if using serverless)
  • samcli: sam logs (if using SAM)

这篇关于您如何看待Amazon Lambda函数的console.log输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆