Class: Fluent::EphemeralBuffer

Inherits:
MemoryBuffer
  • Object
show all
Defined in:
lib/fluent/plugin/buf_ephemeral.rb

Instance Method Summary collapse

Constructor Details

#initializeEphemeralBuffer



7
8
9
10
11
# File 'lib/fluent/plugin/buf_ephemeral.rb', line 7

def initialize
  super

  @log = $log
end

Instance Method Details

#configure(conf) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
# File 'lib/fluent/plugin/buf_ephemeral.rb', line 17

def configure(conf)
  super

  if @buffer_log_level
    set_log_level(@buffer_log_level)
  elsif @log_level
    set_log_level(@log_level)
  end

  @log.warn("If failed to write a chunk once, it will be lost", output_type: conf['type'])
end

#write_chunk(chunk, out) ⇒ Object



29
30
31
32
33
34
# File 'lib/fluent/plugin/buf_ephemeral.rb', line 29

def write_chunk(chunk, out)
  super
rescue => e
  @log.info("failed to write the chunk", error_class: e.class.to_s, error: e.to_s, chunk_key: chunk.key, plugin_id: out.plugin_id)
  @log.info_backtrace(e.backtrace)
end