Go to file
Ryan Buckley a1191bfc15 Launch this thingy 😅 2015-05-05 20:20:23 -07:00
lib/grape/middleware Launch this thingy 😅 2015-05-05 20:20:23 -07:00
.gitignore Launch this thingy 😅 2015-05-05 20:20:23 -07:00
Gemfile Launch this thingy 😅 2015-05-05 20:20:23 -07:00
LICENSE.txt Launch this thingy 😅 2015-05-05 20:20:23 -07:00
README.md Launch this thingy 😅 2015-05-05 20:20:23 -07:00
Rakefile Launch this thingy 😅 2015-05-05 20:20:23 -07:00
grape-middleware-logger.gemspec Launch this thingy 😅 2015-05-05 20:20:23 -07:00

README.md

Grape::Middleware::Logger

Dead until brought to life with the release of Grape v0.12.0

Installation

Add this line to your application's Gemfile:

gem 'grape-middleware-logger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install grape-middleware-logger

Usage

class API < Grape::API
  use Grape::Middleware::Logger
end

Using Grape with Rails? Add consistent logging and param filtering with

use Grape::Middleware::Logger, { 
  logger: Rails.logger, 
  filter: ActionDispatch::Http::ParameterFilter.new(Rails.application.config.filter_parameters)
}

Credits

Big thanks to jadent's question/answer on stackoverflow for easily logging error responses. Borrowed some motivation from the grape_logging gem and would love to see these two consolidated at some point.

Contributing

  1. Fork it ( https://github.com/ridiculous/grape-middleware-logger/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request