Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Record your rack/rails requests and store them for future inspection

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
gemfiles
lib
spec
.travis.yml
Appraisals
Gemfile
Gemfile.lock
Rakefile
Readme.md
request_recorder.gemspec

Readme.md

Record your rack/rails requests and store them for future inspection + see them in your chrome console.

Install

gem install request_recorder

Add to your middleware stack:

require "request_recorder"

require "request_recorder/cache_logger"
use RequestRecorder::Middleware,
  :store => RequestRecorder::CacheLogger.new(Rails.cache),
  :frontend_auth => lambda { |env| Rails.env.development? } # TODO use something like `env.warden.user.is_admin?` in production, or return a [status, headers, body] array for custom failure message
  # if you get 502's because of too large headers, you can reduce them: everything in :remove will be removed when above :max
  # :headers => {:max => 10_000, :remove => [/Identity Map/, /Cache local read/, /Cache read/, /SELECT count(\*)/, /SELECT \* FROM/] }

Usage

  • request a page with /something?request_recorder=10-my_session_name -> record next 10 requests from my browser
  • all the debug-level logging info from rails + activerecord gets stored
  • get log directly from the store or use the frontend

Chrome console

(needs :frontend_auth)

Web-frontend

(needs :frontend_auth)

Frontend

See the log of all requests in the session: /request_recorder/my_session_name. This also includes requests that did not get shown in the chrome logger like redirects.

Author

Michael Grosser
michael@grosser.it
License: MIT
Build Status

Something went wrong with that request. Please try again.