Skip to content

Commit

Permalink
Reduce log size in development/test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
javierm committed Mar 1, 2023
1 parent 79880f0 commit 7871e33
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@

config.action_mailer.preview_path = "#{Rails.root}/spec/mailers/previews"

# Limit size of development 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
Bullet.enable = true
Bullet.bullet_logger = true
Expand Down
6 changes: 6 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@
# Raises error for missing translations.
# 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
Bullet.enable = true
Bullet.bullet_logger = true
Expand Down

0 comments on commit 7871e33

Please sign in to comment.