Class: MEE::RFC5424::SyslogClient

Inherits:
Object
  • Object
show all
Defined in:
lib/mee/rfc5424.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(transport, opts = {}) ⇒ SyslogClient

Returns a new instance of SyslogClient.



47
48
49
50
51
# File 'lib/mee/rfc5424.rb', line 47

def initialize( transport, opts = {} )
  self.transport = transport
  self.framing = opts[:framing] || OctetFraming.new
  self.meta = Meta.new
end

Instance Attribute Details

#framingObject

Returns the value of attribute framing.



45
46
47
# File 'lib/mee/rfc5424.rb', line 45

def framing
  @framing
end

#metaObject

Returns the value of attribute meta.



45
46
47
# File 'lib/mee/rfc5424.rb', line 45

def meta
  @meta
end

#transportObject

Returns the value of attribute transport.



45
46
47
# File 'lib/mee/rfc5424.rb', line 45

def transport
  @transport
end

Instance Method Details

#message(body) ⇒ Object



53
54
55
56
57
58
# File 'lib/mee/rfc5424.rb', line 53

def message( body )
  header = meta.header
  whole_message = header + body
  wire_payload = framing.frame( whole_message )
  transport.send_frame( wire_payload )
end