Merge branch 'hotfix/3.3.7' into develop

This commit is contained in:
Karol Sójko
2020-07-28 18:26:51 +02:00
11 changed files with 76 additions and 40 deletions

View File

@@ -14,8 +14,12 @@ Rails.application.configure do
# Do not eager load code on boot.
config.eager_load = false
require 'custom_log_formatter'
config.log_formatter = CustomLogFormatter.new
MAX_LOG_MEGABYTES = 50
config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, MAX_LOG_MEGABYTES * 1024 * 1024)
if ENV["RAILS_LOG_TO_STDOUT"].present?
config.logger = ActiveSupport::Logger.new(STDOUT)
end
# Show full error reports and disable caching.
config.consider_all_requests_local = true

View File

@@ -7,21 +7,13 @@ Rails.application.configure do
# Code is not reloaded between requests.
config.cache_classes = true
# Use a different logger for distributed setups.
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
MAX_LOG_MEGABYTES = 50
config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, MAX_LOG_MEGABYTES * 1024 * 1024)
if ENV["RAILS_LOG_TO_STDOUT"].present?
config.logger = ActiveSupport::Logger.new(STDOUT)
else
MAX_LOG_MEGABYTES = 50
config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, MAX_LOG_MEGABYTES * 1024 * 1024)
end
require 'custom_log_formatter'
config.log_formatter = CustomLogFormatter.new
config.logger.formatter = config.log_formatter
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.

View File

@@ -8,10 +8,11 @@ Rails.application.configure do
# require 'syslog/logger'
# config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
MAX_LOG_MEGABYTES = 50
config.logger = ActiveSupport::Logger.new(config.paths['log'].first, 1, MAX_LOG_MEGABYTES * 1024 * 1024)
if ENV["RAILS_LOG_TO_STDOUT"].present?
logger = ActiveSupport::Logger.new(STDOUT)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.logger = ActiveSupport::Logger.new(STDOUT)
end
# Eager load code on boot. This eager loads most of Rails and
@@ -73,9 +74,6 @@ Rails.application.configure do
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
# config.active_record.dump_schema_after_migration = false
end

View File

@@ -0,0 +1,6 @@
if ENV['DATADOG_ENABLED'] == 'true'
Datadog.configure do |c|
# This will activate auto-instrumentation for Rails
c.use :rails
end
end

View File

@@ -0,0 +1,14 @@
Rails.application.configure do
config.lograge.enabled = true
# Generate log in JSON
config.lograge.formatter = Lograge::Formatters::Json.new
config.lograge.custom_options = lambda do |event|
{
:ddsource => ["ruby"],
:time => event.time,
:params => event.payload[:params],
:level => event.payload[:level]
}
end
end

View File

@@ -1,5 +1,7 @@
Rails.application.routes.draw do
get "/healthcheck" => "health_check#index"
get '*unmatched_route', to: 'application#route_not_found'
root 'application#app'
end