Class: LogStasher::RequestLogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- LogStasher::RequestLogSubscriber
- Defined in:
- lib/logstasher/log_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#process_action(event) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/logstasher/log_subscriber.rb', line 6 def process_action(event) payload = event.payload data = extract_request(payload) data.merge! extract_status(payload) data.merge! runtimes(event) data.merge! location(event) data.merge! extract_exception(payload) data.merge! extract_custom_fields(payload) = ['request'] .push('exception') if payload[:exception] event = LogStash::Event.new('@source' => LogStasher.source, '@fields' => data, '@tags' => ) LogStasher.logger << event.to_json + "\n" end |
#redirect_to(event) ⇒ Object
22 23 24 |
# File 'lib/logstasher/log_subscriber.rb', line 22 def redirect_to(event) Thread.current[:logstasher_location] = event.payload[:location] end |