Update readme
This commit is contained in:
parent
f015605cfa
commit
96e5eb27e8
18
README.md
18
README.md
|
@ -30,17 +30,6 @@ end
|
||||||
|
|
||||||
Server requests will be logged to STDOUT by default.
|
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
|
## Example output
|
||||||
Get
|
Get
|
||||||
```
|
```
|
||||||
|
@ -58,6 +47,13 @@ Processing by ReportsAPI/reports
|
||||||
Completed 422 in 6.29ms
|
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?
|
## Using Rails?
|
||||||
`Rails.logger` and `Rails.application.config.filter_parameters` will be used automatically as the default logger and
|
`Rails.logger` and `Rails.application.config.filter_parameters` will be used automatically as the default logger and
|
||||||
param filterer, respectively.
|
param filterer, respectively.
|
||||||
|
|
Loading…
Reference in New Issue