Update readme

This commit is contained in:
Ryan Buckley 2016-04-01 00:01:14 -07:00
parent f015605cfa
commit 96e5eb27e8
1 changed files with 7 additions and 11 deletions

View File

@ -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.