lib/elastic_apm/railtie.rb in elastic-apm-0.7.2 vs lib/elastic_apm/railtie.rb in elastic-apm-0.7.3

- old
+ new

@@ -8,10 +8,15 @@ config.elastic_apm = ActiveSupport::OrderedOptions.new Config::DEFAULTS.each { |option, value| config.elastic_apm[option] = value } initializer 'elastic_apm.initialize' do |app| - config = app.config.elastic_apm.merge(app: app) + config = app.config.elastic_apm.merge(app: app).tap do |c| + # Prepend Rails.root to log_path if present + if c.log_path && !c.log_path.start_with?('/') + c.log_path = Rails.root.join(c.log_path) + end + end begin agent = ElasticAPM.start config if agent