feat: add datadog integration and lograge JSON logs formatting
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user