Class: LogStash::Outputs::Airbrake

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/outputs/airbrake.rb

Overview

This output lets you send logs to Airbrake.

Instance Method Summary collapse

Instance Method Details

#receive(event) ⇒ Object



43
44
45
46
47
48
49
50
51
# File 'lib/logstash/outputs/airbrake.rb', line 43

def receive(event)
  return unless output?(event)

  Airbrake.notify(
    :error_class   => @error_type,
    :error_message => event['message'],
    :parameters    => event.to_hash
  )
end

#registerObject



31
32
33
34
35
36
37
38
39
40
# File 'lib/logstash/outputs/airbrake.rb', line 31

def register
  Airbrake.configure do |c|
    c.api_key          = @api_key
    c.environment_name = @environment

    c.host   = @host if @host
    c.port   = @port if @port
    c.secure = @port.to_i == 443
  end
end