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:in `method$   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:in `met$   searchlogic (2.4.27) lib/searchlogic/search/method_missing.rb:58:in `send'   searchlogic (2.4.27) lib/searchlogic/search/method_missing.rb:58:in `method_m$   app/other/restful_component.rb:362:in `find_and_paginate_resources'   app/other/app.rb:31:in `benchmark'   app/other/restful_component.rb:361:in `find_and_paginate_resources'   /usr/local/lib/ruby/1.8/benchmark.rb:308:in `realtime'   rack (1.1.0) lib/rack/head.rb:9:in `call'   rack (1.1.0) lib/rack/methodoverride.rb:24:in `call'   rack (1.1.0) lib/rack/lock.rb:11:in `call'   rack (1.1.0) lib/rack/lock.rb:11:in `synchronize'   rack (1.1.0) lib/rack/lock.rb:11:in `call'   passenger (3.0.6) lib/phusion_passenger/rack/request_handler.rb:96:in `proces$   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:in `m$   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:in `__send__'   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:in `start_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:in `spawn_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:in `spawn_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:in `handle_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:in `server_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.

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