Class: LogStasher::ActiveSupport::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- LogStasher::ActiveSupport::LogSubscriber
- Defined in:
- lib/logstasher/active_support/log_subscriber.rb
Instance Method Summary collapse
Instance Method Details
#logger ⇒ Object
26 27 28 |
# File 'lib/logstasher/active_support/log_subscriber.rb', line 26 def logger LogStasher.logger end |
#process_action(event) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/logstasher/active_support/log_subscriber.rb', line 7 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] logger << LogStasher.build_logstash_event(data, ).to_json + "\n" end |
#redirect_to(event) ⇒ Object
22 23 24 |
# File 'lib/logstasher/active_support/log_subscriber.rb', line 22 def redirect_to(event) Thread.current[:logstasher_location] = event.payload[:location] end |