From 58529dd1baf18376934847718158c219be26f11c Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 26 Apr 2020 13:04:47 +0200 Subject: [PATCH] configuere logging before tracing. #470 --- config/application.rb | 12 ++++++++++++ config/initializers/datadog-tracer.rb | 10 ---------- 2 files changed, 12 insertions(+), 10 deletions(-) delete mode 100644 config/initializers/datadog-tracer.rb diff --git a/config/application.rb b/config/application.rb index ce923ae76..ca7a6bc0a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -83,6 +83,18 @@ class Application < Rails::Application # secret_key_base is not used by Rails API, as there are no sessions config.secret_key_base = "blipblapblup" + # enable datadog tracing here so that we can inject tracing + # information into logs + Datadog.configure do |c| + c.tracer hostname: "datadog.local", enabled: Rails.env.production?, env: Rails.env + c.use :rails, service_name: "client-api" + c.use :elasticsearch + c.use :active_record, analytics_enabled: false + c.use :graphql, schemas: [LupoSchema] + c.use :aws + c.analytics_enabled = true + end + config.lograge.enabled = true config.lograge.formatter = Lograge::Formatters::Logstash.new config.lograge.logger = LogStashLogger.new(type: :stdout) diff --git a/config/initializers/datadog-tracer.rb b/config/initializers/datadog-tracer.rb deleted file mode 100644 index b98b123c0..000000000 --- a/config/initializers/datadog-tracer.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -Datadog.configure do |c| - c.tracer hostname: "datadog.local", enabled: Rails.env.production?, env: Rails.env - c.use :rails, service_name: "client-api" - c.use :elasticsearch - c.use :active_record, analytics_enabled: false - c.use :graphql, schemas: [LupoSchema] - c.analytics_enabled = true -end