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_debug!, log_error!

Class Method Details

.collect_and_log!(extra_fields = nil) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
# File 'lib/datadog/core/diagnostics/environment_logger.rb', line 48

def self.collect_and_log!(extra_fields = nil)
  if log?
    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.class}: #{e.message} Location: #{Array(e.backtrace).first}"
  )
end