Sha256: e526db959d710cb0a32d50be804da660edd4abc42c8c1ece4e25deefeab27570

Contents?: true

Size: 732 Bytes

Versions: 4

Compression:

Stored size: 732 Bytes

Contents

# This file is distributed under New Relic's license terms.
# See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details.
# frozen_string_literal: true

require_relative 'logger/instrumentation'
require_relative 'logger/chain'
require_relative 'logger/prepend'

DependencyDetection.defer do
  named :logger

  depends_on do
    defined?(::Logger) &&
      NewRelic::Agent.config[:'application_logging.enabled']
  end

  executes do
    ::NewRelic::Agent.logger.info("Installing Logger instrumentation")

    if use_prepend?
      prepend_instrument ::Logger, NewRelic::Agent::Instrumentation::Logger::Prepend
    else
      chain_instrument NewRelic::Agent::Instrumentation::Logger
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
newrelic_rpm-8.13.1 lib/new_relic/agent/instrumentation/logger.rb
newrelic_rpm-8.13.0 lib/new_relic/agent/instrumentation/logger.rb
newrelic_rpm-8.12.0 lib/new_relic/agent/instrumentation/logger.rb
newrelic_rpm-8.11.0 lib/new_relic/agent/instrumentation/logger.rb