Class: AwesomeFluentLogger::Formatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/awesome_fluent_logger/formatter.rb

Instance Method Summary collapse

Instance Method Details

#call(severity, time, progname, data) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/awesome_fluent_logger/formatter.rb', line 7

def call(severity, time, progname, data)
  {
    severity: severity,
    time: format_datetime(time),
    progname: progname,
    message: data
  }
end

#datetime_format=(format) ⇒ Object



16
17
18
# File 'lib/awesome_fluent_logger/formatter.rb', line 16

def datetime_format=(format)
  @datetime_format = format == '%iso8601' ? '%Y-%m-%dT%H:%M:%S%:z' : format
end