From 96e5eb27e8d5ad69c9b19167be8568a776b9b892 Mon Sep 17 00:00:00 2001 From: Ryan Buckley Date: Fri, 1 Apr 2016 00:01:14 -0700 Subject: [PATCH] Update readme --- README.md | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f71bd38..cbb7e4a 100644 --- a/README.md +++ b/README.md @@ -30,17 +30,6 @@ end Server requests will be logged to STDOUT by default. -## Customization -Example using a logger and parameter filter: -```ruby -use Grape::Middleware::Logger, { - logger: Logger.new('/tmp/app/log'), - filter: CustomFilter.new -} -``` -The `:logger` option can be any object that responds to `.info(String)` -The `:filter` option can be any object that responds to `.filter(Hash)` and returns a hash. - ## Example output Get ``` @@ -58,6 +47,13 @@ Processing by ReportsAPI/reports Completed 422 in 6.29ms ``` +## Customization + +The middleware logger can be customized with the following options: + +* The `:logger` option can be any object that responds to `.info(String)` +* The `:filter` option can be any object that responds to `.filter(Hash)` and returns a hash. + ## Using Rails? `Rails.logger` and `Rails.application.config.filter_parameters` will be used automatically as the default logger and param filterer, respectively.