在Heroku上查看写入文件系统的日志文件 [英] Viewing log files written to the filesystem on Heroku

查看:81
本文介绍了在Heroku上查看写入文件系统的日志文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个gem(rails-latex),它在部署到Heroku的应用程序上无法正常运行,但在本地应用程序上运行良好.我成功在Heroku上安装了pdflatex,所以这不是问题.

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.

为了进一步调试,我需要查看 Heroku 日志中描述的日志文件

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):

但是由于未保存对Heroku文件系统的更改,因此无法查看input.log文件.有什么方法可以读取此文件或将其重定向到heroku日志?

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?

推荐答案

您可以查看文件系统,但只知道它在dynos之间会有所不同(如果您一直在写文件),并且在dyno出现时它将丢失重新启动或部署应用程序.

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

,您应该在应用程序的bash提示符下放置

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

这篇关于在Heroku上查看写入文件系统的日志文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆