Skip to content

Commit

Permalink
silence logging #405
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Feb 1, 2020
1 parent 47e22f0 commit 3ae3234
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ class Application < Rails::Application
# }
# end
# config.logger = config.lograge.logger
# config.active_record.logger = nil

# Disable loggers that log to file
config.active_record.logger = nil
config.active_job.logger = nil

# configure caching
config.cache_store = :dalli_store, nil, { :namespace => ENV['APPLICATION'] }
Expand Down
6 changes: 4 additions & 2 deletions config/initializers/_lograge.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
config.lograge.enabled = true
config.lograge.formatter = Lograge::Formatters::Logstash.new
config.lograge.logger = LogStashLogger.new(type: :stdout)
config.logger = config.lograge.logger
config.lograge.log_level = ENV["LOG_LEVEL"].to_sym

config.active_job.logger = config.lograge.logger
config.logger = config.lograge.logger

config.lograge.ignore_actions = ["HeartbeatController#index", "IndexController#index"]
config.lograge.ignore_custom = lambda do |event|
Expand All @@ -24,3 +24,5 @@
}
end
end

Rails.cache.silence!
1 change: 1 addition & 0 deletions config/initializers/sentry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@

# ignore 502, 503 and 504 from Elasticsearch
config.excluded_exceptions += ['Elasticsearch::Transport::Transport::Errors::BadGateway', 'Elasticsearch::Transport::Transport::Errors::ServiceUnavailable', 'Elasticsearch::Transport::Transport::Errors::GatewayTimeout']
config.logger = Rails.application.config.lograge.logger
end

0 comments on commit 3ae3234

Please sign in to comment.