Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 25 additions & 25 deletions config/environments/stage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 0 additions & 2 deletions config/initializers/_shoryuken.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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