Class: WebValve::Instrumentation::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- WebValve::Instrumentation::LogSubscriber
- Defined in:
- lib/webvalve/instrumentation/log_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#request(event) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/webvalve/instrumentation/log_subscriber.rb', line 6 def request(event) return unless logger.debug? status = event.payload[:status] method = event.payload[:method].to_s.upcase url = event.payload[:url] host = event.payload[:host] name = '%s %s (%.1fms)' % ["WebValve", "Request Captured", event.duration] details = "#{host} #{method} #{url} [#{status}]" debug " #{color(name, YELLOW, true)} #{color(details, BOLD, true)}" end |