Module: Wildcloud::Logeen::Transport::Syslog

Includes:
EventMachine::Protocols::LineText2
Defined in:
lib/wildcloud/logeen/transport/syslog.rb

Instance Method Summary collapse

Instance Method Details

#initialize(engine) ⇒ Object



11
12
13
# File 'lib/wildcloud/logeen/transport/syslog.rb', line 11

def initialize(engine)
  @engine = engine
end

#post_initObject



15
16
17
# File 'lib/wildcloud/logeen/transport/syslog.rb', line 15

def post_init

end

#receive_line(data) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/wildcloud/logeen/transport/syslog.rb', line 19

def receive_line(data)
  message = SyslogProtocol.parse(data)
  @engine << {
      "level" => message.severity_name,
      "application" => message.hostname,
      "component" => message.facility_name,
      "message" => message.content,
      "timestamp" => message.time.to_i
  }
end

#unbindObject



30
31
32
# File 'lib/wildcloud/logeen/transport/syslog.rb', line 30

def unbind

end