Merge pull request #5142 from consul/local_logs

Reduce log size in development/test environments
This commit is contained in:
Javi Martín
2023-07-03 17:27:40 +02:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -64,6 +64,12 @@ Rails.application.configure do
config.action_mailer.preview_path = "#{Rails.root}/spec/mailers/previews" config.action_mailer.preview_path = "#{Rails.root}/spec/mailers/previews"
# Limit size of local logs
# TODO: replace with config.log_file_size after upgrading to Rails 7.1
logger = ActiveSupport::Logger.new(config.default_log_file, 1, 100.megabytes)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.after_initialize do config.after_initialize do
Bullet.enable = true Bullet.enable = true
Bullet.bullet_logger = true Bullet.bullet_logger = true

View File

@@ -54,6 +54,12 @@ Rails.application.configure do
# Raises error for missing translations. # Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
# Limit size of local logs
# TODO: replace with config.log_file_size after upgrading to Rails 7.1
logger = ActiveSupport::Logger.new(config.default_log_file, 1, 100.megabytes)
logger.formatter = config.log_formatter
config.logger = ActiveSupport::TaggedLogging.new(logger)
config.after_initialize do config.after_initialize do
Bullet.enable = true Bullet.enable = true
Bullet.bullet_logger = true Bullet.bullet_logger = true