Method: Mongrel::Configurator#debug
- Defined in:
- lib/mongrel/configurator.rb
#debug(location, what = [:access, :files, :objects, :threads, :rails]) ⇒ Object
Calling this before you register your URIs to the given location will setup a set of handlers that log open files, objects, and the parameters for each request. This helps you track common problems found in Rails applications that are either slow or become unresponsive after a little while.
You can pass an extra parameter what to indicate what you want to debug. For example, if you just want to dump rails stuff then do:
debug "/", what = [:rails]
And it will only produce the log/mongrel_debug/rails.log file. Available options are: :access, :files, :objects, :threads, :rails
NOTE: Use [:files] to get accesses dumped to stderr like with WEBrick.
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 |
# File 'lib/mongrel/configurator.rb', line 322 def debug(location, what = [:access, :files, :objects, :threads, :rails]) require 'mongrel/debug' handlers = { :access => "/handlers/requestlog::access", :files => "/handlers/requestlog::files", :objects => "/handlers/requestlog::objects", :threads => "/handlers/requestlog::threads", :rails => "/handlers/requestlog::params" } # turn on the debugging infrastructure, and ObjectTracker is a pig MongrelDbg.configure # now we roll through each requested debug type, turn it on and load that plugin what.each do |type| MongrelDbg.begin_trace type uri location, :handler => plugin(handlers[type]) end end |