如果我在puma web服务器上运行,如何从heroku读取log / production.log

时间:2015-07-26 13:26:08

标签: heroku

我正在heroku上运行一个puma web服务器,并希望获取.log文件以检查记录正在回滚的原因。我尝试使用heroku run bash并尝试在puma.rb中搜索配置,但我仍然不知道如何...

有什么建议吗?

编辑:我不想要heroku logs -t,因为它只是显示来自puma输出的日志。我需要输出tail -f log/development.log时会显示更多细节。

我需要它的原因是因为我有一个回滚记录,我不知道为什么。它只发生在生产中而不是开发中,所以我必须找出原因。

2015-07-28T11:01:26.688980+00:00 app[web.1]: Processing by Users::RegistrationsController#create as HTML
2015-07-28T11:01:26.689027+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"ocrYdS3Ysj8dM7A32k7ssBFndoRAJSpM+qlK5Sm2t3ROWm3pSEgAO1htfbSsc/j5FUUXZmRu0RuCp2g2tqfmPw==", "user"=>{"email"=>"ml@llmmllmm.com", "password"=>"[FILTERED]"}, "commit"=>"註冊"}
2015-07-28T11:01:26.812795+00:00 app[web.1]:   Identity Load (1.9ms)  SELECT  "identities".* FROM "identities" WHERE "identities"."email" = $1  ORDER BY "identities"."id" ASC LIMIT 1  [["email", "ml@llmmllmm.com"]]
2015-07-28T11:01:26.825136+00:00 app[web.1]:   User Exists (2.3ms)  SELECT  1 AS one FROM "users" WHERE "users"."referral_code" IS NULL LIMIT 1
2015-07-28T11:01:27.443614+00:00 heroku[router]: at=info method=POST path="/signup" host=new.carshare.hk request_id=c19ac7d2-7805-4c0e-b972-532264656737 fwd="220.241.70.37" dyno=web.1 connect=1ms service=766ms status=200 bytes=15584
2015-07-28T11:01:27.391858+00:00 app[web.1]:   FormUser Exists (13.0ms)  SELECT  1 AS one FROM "users" WHERE "users"."email" = 'ml@llmmllmm.com' LIMIT 1
2015-07-28T11:01:27.423934+00:00 app[web.1]:   Rendered svgs/_carshare_typeface_blue.html (0.6ms)
2015-07-28T11:01:27.426946+00:00 app[web.1]:   Rendered shared/_flash.html.slim (0.1ms)
2015-07-28T11:01:27.398227+00:00 app[web.1]:    (1.9ms)  ROLLBACK

1 个答案:

答案 0 :(得分:0)

你可以拖尾Heroku日志:heroku logs -t -a app-name https://devcenter.heroku.com/articles/logging

此外,您可以在Heroku上试用一些插件,这些插件将为您提供日志的浏览器视图,并允许在其上进行一些过滤 - https://addons.heroku.com/?q=log