Class: AppMonitor::EventNotification

Inherits:
Object
  • Object
show all
Defined in:
lib/appmonitor/event_notification.rb

Class Method Summary collapse

Class Method Details

.build_exception_hash(exception, request, options = {}) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/appmonitor/event_notification.rb', line 9

def self.build_exception_hash(exception, request, options = {})
  params = request.params
  {:klass => params[:controller], :method => params[:action], :message => exception.message.inspect,
   :session => request.session.to_hash, :stack_trace => exception.backtrace.join("\n"),
   :params => request.filtered_parameters,
   :url => request.original_url, :ip_address => request.remote_ip, :time => Time.now.to_i.to_s,
   :environment => Rails.env || ''}
end

.build_rake_event(exception, options) ⇒ Object



18
19
20
21
22
23
# File 'lib/appmonitor/event_notification.rb', line 18

def self.build_rake_event(exception, options)
  rake_called_name = options[:rake_command_line].split(":", 2)
  rake_namespace = rake_called_name.first
  {method: options[:rake_command_line], time: Time.now.to_i.to_s, message: exception.message.inspect, stack_trace:
  exception.backtrace.join("\n"), klass: rake_namespace, environment: Rails.env || ''}
end