【问题标题】:read console log on amazon web services for nodejs app阅读 nodejs 应用程序的亚马逊 Web 服务的控制台日志
【发布时间】:2014-05-22 09:16:35
【问题描述】:

您好,我有一个通过 AWS beanstalk 部署的节点应用程序。

有没有办法在 AWS 上的任何地方读取我的节点脚本中的控制台日志?

谢谢

【问题讨论】:

    标签: javascript node.js amazon-web-services amazon-ec2 amazon-s3


    【解决方案1】:

    在 ssh 之外将日志读取到您的实例中的唯一方法是使用第三方服务,例如 Logentries 或 NewRelic。

    【讨论】:

      【解决方案2】:

      如果您指的是控制台输出,请查看getConsoleOutput SDK reference。例如:

      var params = {
        InstanceId: 'STRING_VALUE', // required
        DryRun: true || false,
      };
      ec2.getConsoleOutput(params, function(err, data) {
        if (err) console.log(err, err.stack); // an error occurred
        else     console.log(data);           // successful response
      });
      

      【讨论】:

      • 当我有 var AWS = require('aws-sdk'); 时,我什至无法部署应用程序;我不断收到 502 Bad Gateway nginx/1.4.7
      • @user1424508 定位 AWS node.js 开发工具包有问题?您是否尝试过向 AWS 提出支持案例?我注意到你也在stackoverflow.com/questions/23797755/…下发布了这个。
      猜你喜欢
      • 1970-01-01
      • 2017-01-14
      • 2012-10-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-07
      • 1970-01-01
      • 2011-06-09
      相关资源
      最近更新 更多