Class: Chihiro::JsonLogFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/chihiro/json_log_formatter.rb

Instance Method Summary collapse

Instance Method Details

#call(severity, _time, _progname, msg) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/chihiro/json_log_formatter.rb', line 4

def call(severity, _time, _progname, msg)
  extra_log_data(msg).merge(
    "level": severity.downcase,
    "project": ENV['PROJECT_NAME'],
    "environment": ENV['RAILS_ENV'],
    "application": ENV['APP_NAME'],
    "dateTime": Time.now
  ).to_json + "\r\n"
end