diff --git a/config/application.rb b/config/application.rb index 0ec87f9bf..ea14312f9 100644 --- a/config/application.rb +++ b/config/application.rb @@ -83,30 +83,30 @@ class Application < Rails::Application # secret_key_base is not used by Rails API, as there are no sessions config.secret_key_base = "blipblapblup" - config.lograge.enabled = true - config.lograge.formatter = Lograge::Formatters::Logstash.new - config.lograge.logger = ::LogStashLogger.new( - type: :stdout, - ) - config.lograge.log_level = ENV["LOG_LEVEL"].to_sym - - config.active_job.logger = config.lograge.logger - - config.lograge.ignore_actions = ["HeartbeatController#index", "IndexController#index"] - config.lograge.ignore_custom = lambda do |event| - event.payload.inspect.length > 100000 - end - config.lograge.base_controller_class = "ActionController::API" - - config.lograge.custom_options = lambda do |event| - exceptions = %w(controller action format id) - { - params: event.payload[:params].except(*exceptions), - uid: event.payload[:uid], - } - end - config.logger = config.lograge.logger - config.active_record.logger = nil + # config.lograge.enabled = true + # config.lograge.formatter = Lograge::Formatters::Logstash.new + # config.lograge.logger = ::LogStashLogger.new( + # type: :stdout, + # ) + # config.lograge.log_level = ENV["LOG_LEVEL"].to_sym + + # config.active_job.logger = config.lograge.logger + + # config.lograge.ignore_actions = ["HeartbeatController#index", "IndexController#index"] + # config.lograge.ignore_custom = lambda do |event| + # event.payload.inspect.length > 100000 + # end + # config.lograge.base_controller_class = "ActionController::API" + + # config.lograge.custom_options = lambda do |event| + # exceptions = %w(controller action format id) + # { + # params: event.payload[:params].except(*exceptions), + # uid: event.payload[:uid], + # } + # end + # config.logger = config.lograge.logger + # config.active_record.logger = nil # configure caching config.cache_store = :dalli_store, nil, { :namespace => ENV['APPLICATION'] } diff --git a/config/initializers/_lograge.rb b/config/initializers/_lograge.rb new file mode 100644 index 000000000..f8cc17dfc --- /dev/null +++ b/config/initializers/_lograge.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require "elasticsearch/rails/lograge" + +Rails.application.configure do + config.lograge.enabled = true + config.lograge.formatter = Lograge::Formatters::Logstash.new + config.lograge.logger = LogStashLogger.new(type: :stdout) + config.lograge.log_level = ENV["LOG_LEVEL"].to_sym + + config.active_job.logger = config.lograge.logger + + config.lograge.ignore_actions = ["HeartbeatController#index", "IndexController#index"] + config.lograge.ignore_custom = lambda do |event| + event.payload.inspect.length > 100000 + end + config.lograge.base_controller_class = "ActionController::API" + + config.lograge.custom_options = lambda do |event| + exceptions = %w(controller action format id) + { + params: event.payload[:params].except(*exceptions), + uid: event.payload[:uid], + } + end +end \ No newline at end of file