Viewing log files written to the filesystem on Heroku

只谈情不闲聊 提交于 2021-01-29 14:57:03

问题


I have a gem (rails-latex) that is not functioning correctly on my app deployed to Heroku but works fine on my local app. I succeeded in installing pdflatex on Heroku so that is not the issue.

To debug this further, I would need to see the log file described in the Heroku logs

2014-03-23T04:32:21.431646+00:00 app[web.1]: This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012)
2014-03-23T04:32:21.431646+00:00 app[web.1]:  \write18 enabled.
2014-03-23T04:32:21.450999+00:00 app[web.1]: entering extended mode
2014-03-23T04:32:21.458053+00:00 app[web.1]: Completed 500 Internal Server Error in 124ms
2014-03-23T04:32:21.458309+00:00 app[web.1]: Completed 500 Internal Server Error in 124ms
2014-03-23T04:32:21.462550+00:00 app[web.1]: 
2014-03-23T04:32:21.462550+00:00 app[web.1]: ActionView::Template::Error (pdflatex failed: See /app/tmp/rails-latex/2--2591673647893672512/input.log for details):
2014-03-23T04:32:21.462550+00:00 app[web.1]:     8: \end{document}
2014-03-23T04:32:21.462550+00:00 app[web.1]:     7: 
2014-03-23T04:32:21.462550+00:00 app[web.1]:   app/views/layouts/menu.pdf.erbtex:9:in `_app_views_layouts_menu_pdf_erbtex___4209895480759438810_30701180'
2014-03-23T04:32:21.462550+00:00 app[web.1]:   app/controllers/restaurants_controller.rb:29:in `menu'
2014-03-23T04:32:21.463589+00:00 app[web.1]:     7: 
2014-03-23T04:32:21.463589+00:00 app[web.1]:     8: \end{document}
2014-03-23T04:32:21.462550+00:00 app[web.1]:     6: <%= yield %>
2014-03-23T04:32:21.462550+00:00 app[web.1]: 
2014-03-23T04:32:21.463589+00:00 app[web.1]:   app/views/layouts/menu.pdf.erbtex:9:in `_app_views_layouts_menu_pdf_erbtex___4209895480759438810_30701180'
2014-03-23T04:32:21.463589+00:00 app[web.1]: 
2014-03-23T04:32:21.462550+00:00 app[web.1]: 
2014-03-23T04:32:21.463589+00:00 app[web.1]:   app/controllers/restaurants_controller.rb:29:in `menu'
2014-03-23T04:32:21.463589+00:00 app[web.1]: 
2014-03-23T04:32:21.463589+00:00 app[web.1]: 
2014-03-23T04:32:21.463589+00:00 app[web.1]:     6: <%= yield %>
2014-03-23T04:32:21.463589+00:00 app[web.1]: ActionView::Template::Error (pdflatex failed: See /app/tmp/rails-latex/2--2591673647893672512/input.log for details):

But since changes to Heroku's filesystem are not saved, I cannot view the input.log file. Is there any way to read this file or redirect it to the heroku logs?


回答1:


You can look at the filesystem but just know that it would differ across dynos (if you've been writing files) and it will be lost when the dyno is restarted or the application is deployed.

To look at the file system perform:

 heroku run bash

and you should be placed at the bash prompt for your application



来源:https://stackoverflow.com/questions/22587210/viewing-log-files-written-to-the-filesystem-on-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!