Rack-Bug: A debugging Toolbar For Rack Applications.
Rack-Bug: A debugging toolbar for Rack applications implemented as middleware. Once it enabled it injects a floating div allowing exploration of logging, database queries, template rendering times, etc.
Versions:
1- 0.3.0 - May 28, 2010 (68 KB)
2- 0.2.1 - August 6, 2009 (65 KB)
Rack-Bug characteristics:
- Password-based security
- IP-based security
- Rack::Bug instrumentation/reporting is broken up into panels.
Panels in default configuration:
- Rails Info
- Timer
- Request Variables
- SQL
- Active Record
- Cache
- Templates
- Log
- Memory
Other bundled panels:
- Redis
- Sphinx
-The API for adding your own panels is simple and powerful
Configuration:
Specify the set of panels you want, in the order you want them to appear:
require "rack/bug"
ActionController::Dispatcher.middleware.use Rack::Bug,
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
:panel_classes => [
Rack::Bug::TimerPanel,
Rack::Bug::RequestVariablesPanel,
Rack::Bug::RedisPanel,
Rack::Bug::TemplatesPanel,
Rack::Bug::LogPanel,
Rack::Bug::MemoryPanel
]
Running Rack::Bug in staging
We have have found that Rack::Bug is fast enough to run in production for specific troubleshooting efforts.
For Configuration
Add the middle-ware configuration to an initialize or the appropriate environment files, taking the rest of this section into consideration.
Security
Restrict access to particular IP addresses:
require "ipaddr"
ActionController::Dispatcher.middleware.use "Rack::Bug"
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
:ip_masks => [IPAddr.new("2.2.2.2/0")]
Restrict access using a password:
ActionController::Dispatcher.middleware.use "Rack::Bug",
:secret_key => "someverylongandveryhardtoguesspreferablyrandomstring",
:password => "yourpassword"
Development:
ليست هناك تعليقات:
إرسال تعليق