Module: Run::Tail

Defined in:
lib/cloudfoundry-graylog2.rb

Instance Method Summary collapse

Instance Method Details

#initialize(component) ⇒ Object



30
31
32
33
# File 'lib/cloudfoundry-graylog2.rb', line 30

def initialize(component)
  @component = component
  @notifier = GELF::Notifier.new(GRAYLOG2_HOST)
end

#receive_line(line) ⇒ Object



34
35
36
37
38
39
40
41
# File 'lib/cloudfoundry-graylog2.rb', line 34

def receive_line(line)
  # puts prefix + line
  @notifier.notify!(prefix + line)
  if line.start_with?('F') # FATAL
    @notifier.notify!(prefix + "fatal error, closing tail")
    close_connection_after_writing
  end
end