Best practices for debugging errors on production mode on server

Hey all,

I think I need some help with best practices for debugging. So I am
familiar with logger.info e.g. “The variable is #{@variable}”. This
helps when I want to inspect the value of a variable on my local
machine. However, it doesn’t get output to the production log so when
the site runs on the server, I don’t know what the variable contains.
And when my local copy is working great, I don’t know what to do when I
get this in production log on server:

Parameters: {“action”=>“index”, “controller”=>“sites”}

NoMethodError (undefined method paginate' for Site:Class): searchlogic (2.4.27) lib/searchlogic/named_scopes/conditions.rb:81:inmethod$
searchlogic (2.4.27)
lib/searchlogic/named_scopes/association_conditions.rb:1$
searchlogic (2.4.27)
lib/searchlogic/named_scopes/association_ordering.rb:27:$
searchlogic (2.4.27) lib/searchlogic/named_scopes/ordering.rb:30:in
method_m$ searchlogic (2.4.27) lib/searchlogic/named_scopes/or_conditions.rb:28:inmet$
searchlogic (2.4.27) lib/searchlogic/search/method_missing.rb:58:in
send' searchlogic (2.4.27) lib/searchlogic/search/method_missing.rb:58:inmethod_m$
app/other/restful_component.rb:362:in find_and_paginate_resources' app/other/app.rb:31:inbenchmark’
app/other/restful_component.rb:361:in find_and_paginate_resources' /usr/local/lib/ruby/1.8/benchmark.rb:308:inrealtime’
rack (1.1.0) lib/rack/head.rb:9:in call' rack (1.1.0) lib/rack/methodoverride.rb:24:incall’
rack (1.1.0) lib/rack/lock.rb:11:in call' rack (1.1.0) lib/rack/lock.rb:11:insynchronize’
rack (1.1.0) lib/rack/lock.rb:11:in call' passenger (3.0.6) lib/phusion_passenger/rack/request_handler.rb:96:inproces$
passenger (3.0.6)
lib/phusion_passenger/abstract_request_handler.rb:513:in a$ passenger (3.0.6) lib/phusion_passenger/abstract_request_handler.rb:274:inm$
passenger (3.0.6)
lib/phusion_passenger/classic_rails/application_spawner.rb:$
passenger (3.0.6)
lib/phusion_passenger/classic_rails/application_spawner.rb:$
passenger (3.0.6)
lib/phusion_passenger/classic_rails/application_spawner.rb:$
passenger (3.0.6) lib/phusion_passenger/utils.rb:479:in safe_fork' passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:$ passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:insend
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in
server_mai$ passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:206:instart_sync$
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:180:in
start' passenger (3.0.6) lib/phusion_passenger/classic_rails/application_spawner.rb:$ passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:219:inspawn_rails_$
passenger (3.0.6)
lib/phusion_passenger/abstract_server_collection.rb:132:in $
passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:214:in
spawn_rails_$ passenger (3.0.6) lib/phusion_passenger/abstract_server_collection.rb:82:in$
passenger (3.0.6)
lib/phusion_passenger/abstract_server_collection.rb:79:in $ passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:213:inspawn_rails_$
passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:132:in
spawn_applic$ passenger (3.0.6) lib/phusion_passenger/spawn_manager.rb:275:inhandle_spawn$
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:in
__send__' passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:357:inserver_mai$
passenger (3.0.6) lib/phusion_passenger/abstract_server.rb:206:in
`start_sync$
passenger (3.0.6) helper-scripts/passenger-spawn-server:99

So clearly it is pointing to the paginate method in this method as the
culrpit:

def find_and_paginate_resources

opts = {:page => @will_paginate_page, :per_page =>

@will_paginate_per_page}
opts.merge!(find_resources_options)
opts.merge!(collect_extra_sortable_options)

App.benchmark "Loading #{@resource_model_name.pluralize}", :verbose,

:pre do

  @resources = @resources.paginate(opts)

end

end

Thanks for response.

On Apr 18, 7:34pm, John M. [email protected] wrote:

Hey all,

I think I need some help with best practices for debugging. So I am
familiar with logger.info e.g. “The variable is #{@variable}”. This
helps when I want to inspect the value of a variable on my local
machine. However, it doesn’t get output to the production log so when
the site runs on the server, I don’t know what the variable contains.
And when my local copy is working great, I don’t know what to do when I
get this in production log on server:

You can either change the threshold at which things end up in the log
file or log at a higher level, eg logger.error instead of logger.info

Fred

Hello

Use the following

  • production log analyser
  • newrelic
  • fiveruns
  • yslow
  • httpperf
  • exception notification

check if you have pagination gem or plugin

regards
-Raghavendra

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs