0.01
No commit activity in last 3 years
No release in over 3 years
Record your rack/rails requests and store them for future inspection
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

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