Class: ActionController::LogSubscriber
- Inherits:
-
Object
- Object
- ActionController::LogSubscriber
- Includes:
- Oink::InstanceTypeCounter
- Defined in:
- lib/log_overrider.rb
Instance Method Summary (collapse)
Methods included from Oink::InstanceTypeCounter
#before_report_active_record_count, included, #report_hash, #report_hash!, #report_instance_type_count
Instance Method Details
- (Object) process_action(event)
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/log_overrider.rb', line 43 def process_action(event) payload = event.payload additions = ActionController::Base.log_process_action(payload) params = payload[:params].except(*INTERNAL_PARAMS) log_hash = {:event => :request_completed, :status => payload[:status], :controller => payload[:controller], :action => payload[:action], :format => payload[:formats].first.to_s.upcase, :ms => ("%.0f" % event.duration).to_i, :params => params.inspect} log_hash.merge!({ :gc_ms => GC.time/1000, :gc_collections => GC.collections, :gc_bytes=> GC.growth}) if GC.respond_to?(:enable_stats) log_hash.merge!({:view_ms => payload[:view_runtime], :db_ms => payload[:db_runtime]}) unless additions.blank? log_hash.merge!(report_hash!) Rails.logger.info(log_hash) end |
- (Object) start_processing(event)
39 40 41 |
# File 'lib/log_overrider.rb', line 39 def start_processing(event) #noop end |