【问题标题】:Google compute enginer/NodeJS: How to monitor console outputsGoogle 计算引擎/Node JS:如何监控控制台输出
【发布时间】:2016-06-23 07:50:01
【问题描述】:

在开发基于 NodeJS 的 Web 应用程序时,我使用 console.log() 来显示警告/错误。这很好,直到它在本地主机中。 然后我将全部部署在 Google 计算引擎中。我使用启动元数据(sudo node /opt/web-app/bin/www) 启动服务器。

现在我无法弄清楚如何查看我的 console.log 消息。有没有办法监控控制台输出或者我必须使用 Stackdriver 之类的东西?

这是我第一次在云中部署,所以请多多指教。 谢谢。

【问题讨论】:

    标签: node.js google-app-engine google-compute-engine console.log


    【解决方案1】:

    Google Stackdriver Logging 确实是将您的应用程序日志发送到您的 Google Cloud 项目并在 Cloud Console 中查看它们的方式:https://cloud.google.com/logging/docs/agent/installation

    除此之外,您还可以以特定格式记录错误,这将使 Google Stackdriver Error Reporting 能够解析它们,详情请参阅https://cloud.google.com/error-reporting/docs/setup/compute-engine

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-10
      • 1970-01-01
      • 1970-01-01
      • 2015-01-16
      • 2019-10-09
      • 1970-01-01
      相关资源
      最近更新 更多