lib/loggable/railtie.rb in researchable_loggable-1.1.0 vs lib/loggable/railtie.rb in researchable_loggable-1.2.0
- old
+ new
@@ -18,10 +18,12 @@
Rails.application.configure do
production_like = Rails.env.production? || config.loggable.production_like
if production_like
Rails.logger = ::EcsLogging::Logger.new($stdout)
Rails.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase || 'INFO')
+
+ Loggable::OpenTelemetryConfig.configure(Rails.application.class.module_parent_name.underscore.dasherize)
end
# lograge configuration
config.lograge.enabled = true
config.lograge.base_controller_class = 'ApplicationController'
@@ -52,9 +54,11 @@
Rails.application.configure do
if defined?(Delayed::Worker)
if Rails.env.production? || config.loggable.production_like
Delayed::Worker.logger = ::EcsLogging::Logger.new($stdout)
Delayed::Worker.logger.level = ActiveSupport::Logger.const_get(config.log_level.to_s.upcase || 'INFO')
+ Loggable::OpenTelemetryConfig.configure("#{Rails.application.class.module_parent_name.underscore.dasherize}
+ -worker")
else
Delayed::Worker.logger = Logger.new($stdout)
Delayed::Worker.logger.level = Logger::DEBUG
Delayed::Worker.logger.datetime_format = '%Y-%m-%d %H:%M:%S'
end