Class: OldApiResource::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- OldApiResource::LogSubscriber
- Defined in:
- lib/old_api_resource/log_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#logger ⇒ Object
9 10 11 |
# File 'lib/old_api_resource/log_subscriber.rb', line 9 def logger Rails.logger end |
#request(event) ⇒ Object
3 4 5 6 7 |
# File 'lib/old_api_resource/log_subscriber.rb', line 3 def request(event) result = event[:payload] info "#{event.payload[:method].to_s.upcase} #{even.payload[:request_uri]}" info "--> %d %s %d (%.1fms)" % [result.code, result., result.body.to_s.length, event.duration] end |