简体   繁体   English

无法从Heroku上的NodeJS应用程序将日志保存到服务器

[英]Can't save logs to server from my nodejs app on heroku

I am using heroku free account and I want to save error and access logs from my nodejs app using morgan on heroku itself. 我正在使用heroku免费帐户,我想保存错误并使用heroku本身上的morgan从我的nodejs应用访问日志。 - Can't access the /var/logs - If I save it in the tree of my app, these logs get deleted on next push as heroku redeploys the app. -无法访问/ var / logs-如果将其保存在应用程序树中,则在heroku重新部署应用程序时,这些日志将在下次推送时被删除。

Is there any way to save the logs and make them persist 有什么方法可以保存日志并使它们持久化

Consider using papertrail or logentries. 考虑使用纸质足迹或登月记录。 They are third-party addons and they have a free plan sufficient for you. 它们是第三方插件,并且有足够的免费计划供您使用。

Heroku restarts your app once a day, so nothing is persistent. Heroku每天重启一次您的应用程序,因此没有任何持久性。 You have to save everything(logs, data, images...) to third-party addons. 您必须将所有内容(日志,数据,图像...)保存到第三方插件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM