Class/Module Index [+]

Quicksearch

Fluent::TextFormatter::HandleTagAndTimeMixin

Public Class Methods

included(klass) click to toggle source
# File lib/fluent/formatter.rb, line 23
def self.included(klass)
  klass.instance_eval {
    config_param :include_time_key, :bool, :default => false
    config_param :time_key, :string, :default => 'time'
    config_param :time_format, :string, :default => nil
    config_param :include_tag_key, :bool, :default => false
    config_param :tag_key, :string, :default => 'tag'
    config_param :localtime, :bool, :default => true
  }
end

Public Instance Methods

configure(conf) click to toggle source
# File lib/fluent/formatter.rb, line 34
def configure(conf)
  super

  if conf['utc']
    @localtime = false
  end
  @timef = TimeFormatter.new(@time_format, @localtime)
end
filter_record(tag, time, record) click to toggle source
# File lib/fluent/formatter.rb, line 43
def filter_record(tag, time, record)
  if @include_tag_key
    record[@tag_key] = tag
  end
  if @include_time_key
    record[@time_key] = @timef.format(time)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.