Module: Datadog::Tracing::Contrib::Rails::LogInjection
- Defined in:
- lib/datadog/tracing/contrib/rails/log_injection.rb
Overview
Rails log injection helper methods
Class Method Summary collapse
-
.configure_log_tags(app_config) ⇒ Object
Use ‘app.config.log_tags` to inject propagation tags into the default Rails logger.
Class Method Details
.configure_log_tags(app_config) ⇒ Object
Use ‘app.config.log_tags` to inject propagation tags into the default Rails logger.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/datadog/tracing/contrib/rails/log_injection.rb', line 11 def (app_config) # When using SemanticLogger, app_config.log_tags could be a Hash and should not be modified here return unless app_config..nil? || app_config..respond_to?(:<<) app_config. ||= [] # Can be nil, we initialized it if so app_config. << proc { Tracing.log_correlation if Datadog.configuration.tracing.log_injection } rescue StandardError => e Datadog.logger.warn( "Unable to add Datadog Trace context to ActiveSupport::TaggedLogging: #{e.class.name} #{e.}" ) false end |