Module: Datadog::Core::Diagnostics::EnvironmentLogger

Extended by:
EnvironmentLogging
Defined in:
lib/datadog/core/diagnostics/environment_logger.rb

Overview

Collects and logs Core diagnostic information

Class Method Summary collapse

Methods included from EnvironmentLogging

log_configuration!, log_error!

Class Method Details

.collect_and_log!(extra_fields = nil) ⇒ Object



61
62
63
64
65
66
67
68
69
# File 'lib/datadog/core/diagnostics/environment_logger.rb', line 61

def self.collect_and_log!(extra_fields = nil)
  log_once! do
    data = EnvironmentCollector.collect_config!
    data = data.merge(extra_fields) if extra_fields
    log_configuration!('CORE', data.to_json)
  end
rescue => e
  logger.warn("Failed to collect core environment information: #{e} Location: #{Array(e.backtrace).first}")
end