【发布时间】:2016-02-26 21:40:26
【问题描述】:
根据this blog,我在heroku 中设置了一个超级简单的node.js 任务。一切似乎都正常,但是当我使用 heroku logs --tail 时,我的 console.log 语句没有显示在控制台中。
我的任务如下所示:
#!/usr/bin/env node
var firebase = require('firebase')
console.log('I have loaded firebase');
我知道它正在运行,因为我在 pacakages.json 中没有 firebase npm 包并得到了预期的错误。一旦解决了这个问题,一切似乎都运行良好,但我的 console.log 行没有得到任何输出。 =[
我使用heroku run reconcileTasks 执行任务并在日志尾部得到以下输出:
2016-02-25T21:47:00.483677+00:00 heroku[api]: Starting process with command `reconcileTasks` by somecoolfella@geemail.com
2016-02-25T21:47:01.648730+00:00 heroku[run.2829]: Awaiting client
2016-02-25T21:47:01.687472+00:00 heroku[run.2829]: Starting process with command `reconcileTasks`
2016-02-25T21:47:01.945501+00:00 heroku[run.2829]: State changed from starting to up
2016-02-25T21:47:03.964158+00:00 heroku[run.2829]: Process exited with status 0
2016-02-25T21:47:03.991854+00:00 heroku[run.2829]: State changed from up to complete
【问题讨论】: