admin管理员组文章数量:1357148
I've tried to debug my app by using console.log() inside Node.js.
However, I can never see them in heroku log no matter how many lines they show.
$ heroku logs -n 200
This didn't work for me.
Whenever I post something on Heroku server, the log only shows something like:
2018-09-10T02:14:12.731148+00:00 heroku[router]: at=info method=POST path="/users" host=obscure-journey-65698.herokuapp request_id=349a44e8-5fd7-46a2-aacb-75e51503109c fwd="73.67.204.217" dyno=web.1 connect=1ms service=355ms status=400 bytes=216 protocol=https
The console log never shows up! They do log the information I want when running npm start.
Thanks for any help.
I've tried to debug my app by using console.log() inside Node.js.
However, I can never see them in heroku log no matter how many lines they show.
$ heroku logs -n 200
This didn't work for me.
Whenever I post something on Heroku server, the log only shows something like:
2018-09-10T02:14:12.731148+00:00 heroku[router]: at=info method=POST path="/users" host=obscure-journey-65698.herokuapp. request_id=349a44e8-5fd7-46a2-aacb-75e51503109c fwd="73.67.204.217" dyno=web.1 connect=1ms service=355ms status=400 bytes=216 protocol=https
The console log never shows up! They do log the information I want when running npm start.
Thanks for any help.
Share Improve this question asked Sep 10, 2018 at 3:49 KeiKei 6212 gold badges11 silver badges26 bronze badges2 Answers
Reset to default 5go to the heroku website and open your deployed app. go the more tab to the right corner and open logs. At log tab you will see the console outputs. you will see the console outputs of the file which is written in procfile or the file which is the first to execute. For example if have written in procfile that: web: node server.js then the server.js file will be the first one to execute. so if i have written console.log("output") in my server.js file then the output will be shown in logs of heroku which is in more tab as described above. Thanks
You can use an add-on called Papertrail. It has a free tier which should do the job.
本文标签: javascriptHow to show consolelog() on HerokuStack Overflow
版权声明:本文标题:javascript - How to show console.log() on Heroku? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744068286a2585414.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论