当我在服务器上查看我的Heroku的日志(与heroku logs --tail --app myapp
)我看到这样的内容:Heroku:在日志中查看params和sql活动?
2011-06-21T14:09:25+00:00 app[web.1]: Started PUT "/reports/19.xml" for 77.89.149.137 at 2011-06-21 07:09:25 -0700
2011-06-21T14:09:25+00:00 heroku[router]: PUT myapp.heroku.com/reports/19.xml dyno=web.1 queue=0 wait=0ms service=7ms status=401 bytes=28
2011-06-21T14:09:26+00:00 heroku[nginx]: PUT /reports/19.xml HTTP/1.1 | 77.89.149.137 | 656 | http | 401
虽然在我的本地日志我会看到这样的内容:
Started PUT "/reports/19" for 127.0.0.1 at 2011-06-21 15:27:01 +0100
Processing by ReportsController#update as XML
Parameters: {"report"=>{"workflow_status"=>"3"}, "id"=>"19"}
Person Load (0.9ms) SELECT "people".* FROM "people" WHERE "people"."email" = '[email protected]' LIMIT 1
Report Load (0.4ms) SELECT "reports".* FROM "reports" WHERE "reports"."id" = 19 LIMIT 1
DEPRECATION WARNING: Object#returning has been deprecated in favor of Object#tap. (called from update_report at /home/max/work/rails_apps/flamingo_container/flamingo/vendor/plugins/resource_this/lib/resource_this.rb:135)
Creating scope :open. Overwriting existing method Task.open.
Task Load (2.0ms) SELECT "tasks".* FROM "tasks" WHERE "tasks"."id" = 14 LIMIT 1
Completed 200 OK in 1648ms (Views: 568.2ms | ActiveRecord: 3.2ms)
即用更多的信息,特别是params,来自路由器的信息,生成的sql,任何模板呈现等等等。
有没有人知道我如何让我的英雄日志像我的发展一样冗长?我已经做了以下不已:
1)设置日志级别,在相关的(轨道3)环境文件:
config.log_level = :debug
2)告诉Heroku上使用不同的记录水平,在http://devcenter.heroku.com/articles/logging描述
heroku config:add LOG_LEVEL=DEBUG --app myapp #from CLI
没有任何区别...任何想法的人?
谢谢,最大
aha,太好了!谢谢:) –
很高兴帮助,最大! – iwasrobbed
太棒了!这对我也有效,Heroku的支持告诉我,我的一个宝石超越了输出。将代码添加到'production.rb'而不是'application.rb'可能更合适,只是一个想法。 – Bob