karmi / tire-contrib

Additions and extensions for the Tire gem
MIT License
65 stars 31 forks source link

Search info not in log (re: tire/rails/logger) #6

Closed mattscilipoti closed 11 years ago

mattscilipoti commented 12 years ago

After updating my Gemfile, bundle'ing, adding "require 'tire/rails/logger'" to an initializer, and restarting my server, I do not see the "Search" info in the "GET" entry as indicated.

Rails 3.2.8 Ruby 1.9.3p194

# You should see an output like this in your application log:
#
#     Started GET "/articles?utf8=%E2%9C%93&q=bull*&commit=search" for 127.0.0.1 at 2011-09-15 19:07:00 +0200
#       Processing by ArticlesController#index as HTML
#       Parameters: {"utf8"=>"✓", "q"=>"bull*", "commit"=>"search"}
#       Search (6.7ms)  {"query":{"query_string":{"query":"bull*"}}}
#       Article Load (0.3ms)  SELECT `articles`.* FROM `articles` WHERE `articles`.`id` IN (104126575)
#     Rendered articles/index.html.erb within layouts/application (13.0ms)
#     Completed 200 OK in 63ms (Views: 53.7ms | ActiveRecord: 1.8ms | Tire: 6.7ms)

Instead, I see:

2012-11-02 15:22:49.360 [fyi] Started GET "/admin/quizzes/5/edit?utf8=%E2%9C%93&question_query=stickers&commit=Search" for 127.0.0.1 at 2012-11-02 15:22:49 -0400 (pid:19572)
2012-11-02 15:22:49.582 [fyi] Processing by Admin::QuizzesController#edit as HTML (pid:19572)
  Parameters: {"utf8"=>"✓", "question_query"=>"stickers", "commit"=>"Search", "id"=>"5"}
  User Load (0.9ms)  SELECT ...

If my testing is correct, log_process_action (in tire-contrib / lib / tire / rails / logger / controller_runtime.rb), is not even called.

ike-bloomfire commented 11 years ago

put it in your application.rb file

mattscilipoti commented 11 years ago

Thanks. That was it.

ankane commented 11 years ago

I just ran into the same issue. The readme makes it sound like you should put it inside config/initializers. You may want to make this clearer.