add client env usage

This commit is contained in:
romain.sagean 2016-04-12 11:21:13 +02:00
parent d883bb9263
commit 2717b4a3ec

View file

@ -50,11 +50,16 @@ You can include logging of other parts of the request / response cycle by includ
use GrapeLogging::Middleware::RequestLogger,
logger: logger,
include: [ GrapeLogging::Loggers::Response.new,
GrapeLogging::Loggers::FilterParameters.new ]
GrapeLogging::Loggers::FilterParameters.new,
GrapeLogging::Loggers::ClientEnv.new ]
end
#### FilterParameters
The `FilterParameters` logger will filter out sensitive parameters from your logs. If mounted inside rails, will use the `Rails.application.config.filter_parameters` by default. Otherwise, you must specify a list of keys to filter out.
#### ClientEnv
The `FilterParameters` logger will add `ip` and user agent `ua` in your log.
### Logging to file and STDOUT
You can log to file and STDOUT at the same time, you just need to assign new logger