Permalink
Browse files

Send params to logger

  • Loading branch information...
TiteiKo committed Aug 9, 2017
1 parent 06c0ecd commit 0b7a07969c7f419072186a81bdcccdbe0ec55155
Showing with 8 additions and 4 deletions.
  1. +8 −4 lib/hanami/common_logger.rb
@@ -34,11 +34,15 @@ class CommonLogger < Rack::CommonLogger

# @since 1.0.0
# @api private
QUERY_STRING = 'QUERY_STRING'.freeze
RACK_ERRORS = 'rack.errors'.freeze

# @since 1.0.0
# @since x.x.x
# @api private
RACK_ERRORS = 'rack.errors'.freeze
QUERY_HASH = 'rack.request.query_hash'.freeze

# @since x.x.x
# @api private
FORM_HASH = 'rack.request.form_hash'.freeze

# @since 1.0.0
# @api private
@@ -55,8 +59,8 @@ def log(env, status, header, began_at)
status: status.to_s[0..3],
ip: env[HTTP_X_FORWARDED_FOR] || env[REMOTE_ADDR],
path: env[SCRIPT_NAME] + env[PATH_INFO],
query: env[QUERY_STRING],
length: length,
params: env[QUERY_HASH].merge(env[FORM_HASH]),
elapsed: now - began_at
]

0 comments on commit 0b7a079

Please sign in to comment.