diff --git a/config/environments/production.rb b/config/environments/production.rb index 7c3235b0a..4bcbef198 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -105,4 +105,6 @@ Rails.application.configure do protocol: :https, host: ENV['APP_HOST'] } + + config.lograge.enabled = ENV['LOGRAGE_ENABLED'] == 'enabled' end diff --git a/config/initializers/active_job_log_subscriber.rb b/config/initializers/active_job_log_subscriber.rb index b630519dd..cfcddc188 100644 --- a/config/initializers/active_job_log_subscriber.rb +++ b/config/initializers/active_job_log_subscriber.rb @@ -40,6 +40,7 @@ class ActiveJobLogSubscriber < ::ActiveJob::Logging::LogSubscriber tags.push('exception') if data[:exception] data[:tags] = tags data[:type] = 'tps' + data[:source] = ENV['SOURCE'] log(data) end diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index 0140b2346..8fec7ceea 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -10,6 +10,7 @@ Rails.application.configure do config.lograge.custom_options = lambda do |event| { type: 'tps', + source: ENV['SOURCE'], tags: ['request', event.payload[:exception] ? 'exception' : nil].compact, user_id: event.payload[:user_id], user_email: event.payload[:user_email],