Class: LogStashLogger::Device::TCP

Inherits:
Socket show all
Defined in:
lib/logstash-logger/device/tcp.rb

Constant Summary

Constants inherited from Socket

Socket::DEFAULT_HOST

Instance Attribute Summary collapse

Attributes inherited from Socket

#host, #port

Attributes inherited from Base

#io, #sync

Instance Method Summary collapse

Methods inherited from Connectable

#connected?, #flush, #to_io, #write

Methods inherited from Base

#close, #flush, #to_io, #write

Constructor Details

#initialize(opts) ⇒ TCP

Returns a new instance of TCP.



8
9
10
11
12
13
# File 'lib/logstash-logger/device/tcp.rb', line 8

def initialize(opts)
  super

  @ssl_certificate = opts[:ssl_certificate]
  @use_ssl = !!(@ssl_certificate || opts[:use_ssl] || opts[:ssl_enable])
end

Instance Attribute Details

#ssl_certificateObject (readonly)

Returns the value of attribute ssl_certificate.



6
7
8
# File 'lib/logstash-logger/device/tcp.rb', line 6

def ssl_certificate
  @ssl_certificate
end

Instance Method Details

#use_ssl?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/logstash-logger/device/tcp.rb', line 15

def use_ssl?
  @use_ssl || !@ssl_certificate.nil?
end