mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-04-27 14:57:40 +00:00
add client env usage
This commit is contained in:
parent
d883bb9263
commit
2717b4a3ec
1 changed files with 13 additions and 8 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue