使用 Meteor 和 Meteor Up 时如何监控服务器端日志

How to monitor server-side log when using Meteor and Meteor Up

我正在使用 Meteor 和 Meteor UP 进行部署。 到目前为止,一切都很好。 我可以将我的项目部署到我的测试 Ubuntu 服务器。

我的问题是我不知道如何在服务器上进行调试。 如果我用node.js表达,我直接写console.log("some error")就可以看到日志了

日志文件好像是/var/log/upstart/.log 但我只能找到

 >> stepping down to gid: meteoruser
 >> stepping down to uid: meteoruser

有没有办法输出"console.log(something)"?

我使用 Ubuntu-14.04 和 Meteor 1.1.0.2。

是的,有。像往常一样在服务器端代码中执行 console.log(something)。然后从你的 meteor-up 目录中的 Ubuntu 服务器(你做 mup deploy 的地方),做 mup logs -f

这将使您能够实时监控日志。

更新: 对于使用新 mupx 的用户,您可以使用 mupx logs -f

查看日志

(ref)