Skip to content

Commit

Permalink
set back logging to november position and correctly configure log_level
Browse files Browse the repository at this point in the history
## LogStashLogger needs to be pass to rails logger, see roidrage/lograge#26
## Log level in a config level configuration

Confirmed that log_level is respected
  • Loading branch information
kjgarza committed Feb 7, 2020
1 parent 4622933 commit 1877a09
Showing 1 changed file with 20 additions and 24 deletions.
44 changes: 20 additions & 24 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,34 +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

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

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 ## Log level in a config level configuration

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

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

Expand Down

0 comments on commit 1877a09

Please sign in to comment.