diff --git a/config/application.rb b/config/application.rb index b8e681c..ff0edda 100644 --- a/config/application.rb +++ b/config/application.rb @@ -41,12 +41,38 @@ class Application < Rails::Application config.middleware.use(Rack::Deflater) - config.active_job.logger = Logger.new(nil) - config.secret_key_base = "blipblapblup" - config.logger = Logger.new($stdout) - config.log_level = :info + # config.active_job.logger = Logger.new(nil) + # config.logger = Logger.new($stdout) + # config.log_level = :info + + # Start: Configure Logging + config.active_job.logger = Rails.logger + config.lograge.enabled = true + config.lograge.formatter = Lograge::Formatters::Logstash.new + config.lograge.logger = LogStashLogger.new(type: :stdout) + config.logger = config.lograge.logger ## LogStashLogger needs to be pass to rails logger, see roidrage/lograge#26 + config.log_level = ENV["LOG_LEVEL"].to_sym + + config.lograge.ignore_actions = [ + "HeartbeatController#index", + "IndexController#index", + ] + config.lograge.ignore_custom = lambda do |event| + event.payload.inspect.length > 100_000 + end + config.lograge.base_controller_class = "ActionController::API" + + config.lograge.custom_options = lambda do |event| + exceptions = ["controller", "action", "format", "id"] + { + ddsource: ["ruby"], + params: event.payload[:params].except(*exceptions), + uid: event.payload[:uid], + } + end + # End: Configure Logging config.active_job.queue_adapter = :shoryuken config.active_job.queue_name_prefix = Rails.env diff --git a/config/environments/stage.rb b/config/environments/stage.rb index 8743ea6..2dcadb0 100644 --- a/config/environments/stage.rb +++ b/config/environments/stage.rb @@ -61,29 +61,29 @@ # Do not dump schema after migrations. # config.active_record.dump_schema_after_migration = false - # Start: Configure Logging - config.lograge.enabled = true - config.lograge.formatter = Lograge::Formatters::Logstash.new - config.lograge.logger = LogStashLogger.new(type: :stdout) - config.logger = config.lograge.logger ## LogStashLogger needs to be pass to rails logger, see roidrage/lograge#26 - config.log_level = ENV["LOG_LEVEL"].to_sym - - config.lograge.ignore_actions = [ - "HeartbeatController#index", - "IndexController#index", - ] - config.lograge.ignore_custom = lambda do |event| - event.payload.inspect.length > 100_000 - end - config.lograge.base_controller_class = "ActionController::API" - - config.lograge.custom_options = lambda do |event| - exceptions = ["controller", "action", "format", "id"] - { - ddsource: ["ruby"], - params: event.payload[:params].except(*exceptions), - uid: event.payload[:uid], - } - end - # End: Configure Logging + # # Start: Configure Logging + # config.lograge.enabled = true + # config.lograge.formatter = Lograge::Formatters::Logstash.new + # config.lograge.logger = LogStashLogger.new(type: :stdout) + # config.logger = config.lograge.logger ## LogStashLogger needs to be pass to rails logger, see roidrage/lograge#26 + # config.log_level = ENV["LOG_LEVEL"].to_sym + + # config.lograge.ignore_actions = [ + # "HeartbeatController#index", + # "IndexController#index", + # ] + # config.lograge.ignore_custom = lambda do |event| + # event.payload.inspect.length > 100_000 + # end + # config.lograge.base_controller_class = "ActionController::API" + + # config.lograge.custom_options = lambda do |event| + # exceptions = ["controller", "action", "format", "id"] + # { + # ddsource: ["ruby"], + # params: event.payload[:params].except(*exceptions), + # uid: event.payload[:uid], + # } + # end + # # End: Configure Logging end diff --git a/config/initializers/_shoryuken.rb b/config/initializers/_shoryuken.rb index 50748ab..78c39bb 100644 --- a/config/initializers/_shoryuken.rb +++ b/config/initializers/_shoryuken.rb @@ -11,5 +11,3 @@ # This ensures that we work with queues that # have an environment prefix i.e. stage_events or development_events Shoryuken.active_job_queue_name_prefixing = true - -Shoryuken::Logging.logger = Rails.logger