module Fluent::TextFormatter::StructuredFormatMixin

Public Class Methods

included(klass) click to toggle source
# File lib/fluent/formatter.rb, line 104
def self.included(klass)
  klass.instance_eval {
    config_param :time_as_epoch, :bool, :default => false
  }
end

Public Instance Methods

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

  if @time_as_epoch
    if @include_time_key
      @include_time_key = false
    else
      $log.warn "include_time_key is false so ignore time_as_epoch"
      @time_as_epoch = false
    end
  end
end
format(tag, time, record) click to toggle source
# File lib/fluent/formatter.rb, line 123
def format(tag, time, record)
  filter_record(tag, time, record)
  record[@time_key] = time if @time_as_epoch
  format_record(record)
end