Repository is archived
No commit activity in last 3 years
No release in over 3 years
rails_log_autotruncator is a simple patch for ActiveSupport::BufferedLogger that limits a log file size. Use it if you just don't want your rails project development or test log file becomes large.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.5.2
 Project Readme

rails_log_autotruncator — Rails log auto truncate

rails_log_autotruncator is a simple (monkey)patch for ActiveSupport::BufferedLogger that limits a log file size. Use it if you just don't want your rails project development or test log file becomes large.

Disclaimer

You don't need this gem for ruby 1.9.3 and up. You can add the following code to your environment config file (i.e. config/environments/test.rb) for Rails 4:

config.logger = Logger.new(config.paths['log'].first, 1, 5.megabytes)

For Rails 3:

config.logger = Logger.new(config.paths.log.first, 1, 5.megabytes)

5.megabytes is a max log file size in this case. You can adjust it according to your needs.

Compatibility

  • Ruby 1.9.2 Rails 3.0.6
  • Ruby 1.8.7 Rails 2.3.5

Installation

Bundler

Add the rails_log_autotruncator gem to your Gemfile:

group :development, :test do
  gem 'rails_log_autotruncator'
end
Rails 2 without Bundler
gem install rails_log_autotruncator

then add to your environment.rb to Rails::Initializer.run:

config.gem "rails_log_autotruncator", :lib => "rails_log_autotruncator"

Copyright

Copyright (c) 2011 Dzmitry Plashchynski. See LICENSE for details.