Skip to content

Commit

Permalink
move lograge
Browse files Browse the repository at this point in the history
  • Loading branch information
kjgarza committed Jan 30, 2020
1 parent b815388 commit 8b5cc6b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
25 changes: 25 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,31 @@ 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

# configure caching
config.cache_store = :dalli_store, nil, { :namespace => ENV['APPLICATION'] }

Expand Down
26 changes: 0 additions & 26 deletions config/initializers/_lograge.rb

This file was deleted.

0 comments on commit 8b5cc6b

Please sign in to comment.