Class: Fluent::Label

Inherits:
Agent
  • Object
show all
Defined in:
lib/fluent/label.rb

Constant Summary

Constants included from Configurable

Configurable::CONFIG_TYPE_REGISTRY

Instance Attribute Summary collapse

Attributes inherited from Agent

#context, #error_collector, #event_router, #filters, #log, #outputs

Instance Method Summary collapse

Methods inherited from Agent

#add_filter, #add_match, #lifecycle, #lifecycle_control_list

Methods included from Configurable

#config, #configure_proxy_generate, #configured_section_create, included, lookup_type, register_type

Constructor Details

#initialize(name, log:) ⇒ Label

Returns a new instance of Label.



21
22
23
24
25
26
# File 'lib/fluent/label.rb', line 21

def initialize(name, log:)
  super(log: log)

  @context = name
  @root_agent = nil
end

Instance Attribute Details

#root_agentObject

Returns the value of attribute root_agent.



28
29
30
# File 'lib/fluent/label.rb', line 28

def root_agent
  @root_agent
end

Instance Method Details

#configure(conf) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/fluent/label.rb', line 30

def configure(conf)
  super

  if conf.elements('match').size == 0
    raise ConfigError, "Missing <match> sections in <label #{@context}> section"
  end
end

#emit_error_event(tag, time, record, e) ⇒ Object



38
39
40
# File 'lib/fluent/label.rb', line 38

def emit_error_event(tag, time, record, e)
  @root_agent.emit_error_event(tag, time, record, e)
end

#handle_emits_error(tag, es, e) ⇒ Object



42
43
44
# File 'lib/fluent/label.rb', line 42

def handle_emits_error(tag, es, e)
  @root_agent.handle_emits_error(tag, es, e)
end