Class: LogStashLogger::Device::Unix
- Inherits:
-
Connectable
- Object
- Base
- Connectable
- LogStashLogger::Device::Unix
- Defined in:
- lib/logstash-logger/device/unix.rb
Instance Attribute Summary
Attributes inherited from Connectable
Attributes inherited from Base
Instance Method Summary collapse
- #connect ⇒ Object
-
#initialize(opts = {}) ⇒ Unix
constructor
A new instance of Unix.
Methods inherited from Connectable
#close, #connected?, #flush, #on_full_buffer_receive, #reconnect, #reset, #to_io, #with_connection, #write, #write_batch, #write_one
Methods included from Buffer
#buffer_flush, #buffer_full?, #buffer_initialize, #buffer_receive, #reset_buffer
Methods inherited from Base
#close, #close!, #flush, #reset, #to_io, #unrecoverable_error?, #write, #write_batch, #write_one
Constructor Details
#initialize(opts = {}) ⇒ Unix
Returns a new instance of Unix.
6 7 8 9 |
# File 'lib/logstash-logger/device/unix.rb', line 6 def initialize(opts={}) super @path = opts[:path] || fail(ArgumentError, "Path is required") end |
Instance Method Details
#connect ⇒ Object
11 12 13 14 15 |
# File 'lib/logstash-logger/device/unix.rb', line 11 def connect @io = ::UNIXSocket.new(@path).tap do |socket| socket.sync = sync unless sync.nil? end end |