I have a Rails application but after some time of development/debugging I realized that it would be very helpful to be able to see the whole HTTP request in the logfiles - l
That logger.info request.env
code works fine in a Rails controller, but to see a more original version of that, or if you're using Grape or some other mounted app, you have to intercept the request on its way through the rack middleware chain...
Put this code in your lib directory (or at the bottom of application.rb
):
require 'pp'
class Loggo
def initialize(app)
@app = app
end
def call(env)
pp env
@app.call(env)
end
end
then in with the other config
s in application.rb
:
config.middleware.use "Loggo"