herokuでサーバーのログを参照する
エラーが発生しているときはログが頼りになりますが、herokuの場合はcommand-line toolを使用します。
環境
- Rails 2.3.5
- Ruby 1.8.7
- gem heroku 1.8.3
コマンド
heroku logsコマンドを使用します。
toshifusa@TOSHIFUSA-PC ~/Documents/NetBeansProjects/assist (master) $ heroku logs ==> production.log <== # Logfile created on Thu Apr 01 02:06:59 -0700 2010 Processing ModelsController#index (for 124.155.33.170 at 2010-04-01 02:07:02) [G ET] Rendering template within layouts/application Rendering models/index Completed in 31ms (View: 25, DB: 8) | 200 OK [http://bwz.heroku.com/] Processing ModelsController#search (for 124.155.33.170 at 2010-04-01 02:07:39) [ POST] Parameters: {"cmd"=>"1", "authenticity_token"=>"M+k/Sdpke+0NU/YRbFI+L47cb4mvc/ 2xOlIidPkbvNM=", "model_id"=>"3"} ActionView::TemplateError (missing attribute: bb_count) on line #26 of app/views /models/_log_summary.html.erb: 23: <td><%=h number_with_delimiter(machine_log.margin) %></td> 24: <td><%=h number_with_precision(machine_log.sales.to_f / machine_log.in_c ount.to_f, :precision => 2) %></td> 25: <td><%=h number_with_precision(machine_log.margin.to_f / machine_log.in_ count.to_f, :precision => 2) %></td> 26: <td><%=h number_with_delimiter(machine_log.bb_count) %></td> 27: <td><%=h number_with_delimiter(machine_log.rb_count) %></td> 28: </tr> 29: <% end %> app/views/models/_log_summary.html.erb:26 app/views/models/_log_summary.html.erb:15:in `each' app/views/models/_log_summary.html.erb:15 app/controllers/models_controller.rb:27:in `__instance_exec0' app/controllers/models_controller.rb:24:in `search' /home/heroku_rack/lib/static_assets.rb:9:in `call' /home/heroku_rack/lib/last_access.rb:25:in `call' /home/heroku_rack/lib/date_header.rb:14:in `call' thin (1.0.1) lib/thin/connection.rb:80:in `pre_process' thin (1.0.1) lib/thin/connection.rb:78:in `catch' thin (1.0.1) lib/thin/connection.rb:78:in `pre_process' thin (1.0.1) lib/thin/connection.rb:57:in `process' thin (1.0.1) lib/thin/connection.rb:42:in `receive_data' eventmachine (0.12.6) lib/eventmachine.rb:240:in `run_machine' eventmachine (0.12.6) lib/eventmachine.rb:240:in `run' thin (1.0.1) lib/thin/backends/base.rb:57:in `start' thin (1.0.1) lib/thin/server.rb:150:in `start' thin (1.0.1) lib/thin/controllers/controller.rb:80:in `start' thin (1.0.1) lib/thin/runner.rb:173:in `send' thin (1.0.1) lib/thin/runner.rb:173:in `run_command' thin (1.0.1) lib/thin/runner.rb:139:in `run!' thin (1.0.1) bin/thin:6 /usr/local/bin/thin:20:in `load' /usr/local/bin/thin:20 Rendering /disk1/home/slugs/142966_1a8de2d_4e75/mnt/public/500.html (500 Interna l Server Error) ==> dyno-1001087.log <== >> Thin web server (v1.0.1 codename ?) >> Maximum connections set to 1024 >> Listening on 0.0.0.0:26694, CTRL+C to stop