Class: LogStasher::ActiveSupport::LogSubscriber
- Inherits:
-
ActiveSupport::LogSubscriber
- Object
- ActiveSupport::LogSubscriber
- LogStasher::ActiveSupport::LogSubscriber
- Includes:
- CustomFields::LogSubscriber
- Defined in:
- lib/logstasher/active_support/log_subscriber.rb
Instance Method Summary collapse
Methods included from CustomFields::LogSubscriber
Instance Method Details
#logger ⇒ Object
30 31 32 |
# File 'lib/logstasher/active_support/log_subscriber.rb', line 30 def logger LogStasher.logger end |
#process_action(event) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/logstasher/active_support/log_subscriber.rb', line 10 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! LogStasher.store 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
26 27 28 |
# File 'lib/logstasher/active_support/log_subscriber.rb', line 26 def redirect_to(event) Thread.current[:logstasher_location] = event.payload[:location] end |