Class: ScoutApm::Logger::DefaultFormatter

Inherits:
Logger::Formatter
  • Object
show all
Defined in:
lib/scout_apm/logger.rb

Direct Known Subclasses

TaggedFormatter

Instance Method Summary collapse

Instance Method Details

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



141
142
143
144
145
# File 'lib/scout_apm/logger.rb', line 141

def call(severity, time, progname, msg)
  # since STDOUT isn't exclusive like the scout_apm.log file, apply a prefix.
  # XXX: Pass in context to the formatter
  "[#{Utils::Time.to_s(time)} #{ScoutApm::Agent.instance.context.environment.hostname} (#{$$})] #{severity} : #{msg}\n"
end