class NewRelic::Agent::Logging::DecoratingLogger

This logger decorates logs with trace and entity metadata, and emits log messages formatted as JSON objects. It extends the Logger class from the Ruby standard library, and accepts the same constructor parameters.

It aliases the ‘:info` message to overwrite the `:write` method, so it can be used in Rack applications that expect the logger to be a file-like object.

It can be added to an application like this:

require 'newrelic_rpm'

config.logger = NewRelic::Agent::Logging::DecoratingLogger.new "log/application.log"

@api public

Public Class Methods

new(*args) click to toggle source
Calls superclass method
# File lib/new_relic/agent/logging.rb, line 169
def initialize(*args)
  super(*args)
  self.formatter = DecoratingFormatter.new
end