Class: Rack::LogFilter
- Inherits:
-
Object
- Object
- Rack::LogFilter
- Defined in:
- lib/rack/simple_logger/log_filter.rb
Instance Method Summary collapse
Instance Method Details
#pass(env, status, header, began_at) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rack/simple_logger/log_filter.rb', line 5 def pass(env, status, header, began_at) { xff: env["HTTP_X_FORWARDED_FOR"] || "-", host: env["REMOTE_ADDR"], time: began_at.strftime("%Y-%m-%d %H:%M:%S"), method: env["REQUEST_METHOD"], path: env["PATH_INFO"], query_strings: env["QUERY_STRING"] || "-", status: status, ua: env["HTTP_USER_AGENT"], res_size: header["Content-Length"], app_time: Time.now - began_at } end |