Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The tool for automatically rotating and truncating a rails development log file

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .document
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 LICENSE.txt
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 VERSION
Octocat-spinner-32 init.rb
Octocat-spinner-32 rails_log_autotruncator.gemspec
README.rdoc

rails_log_autotruncator

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.

You don't need this gem if you use ruby 1.9.3, just add the following code to your environment config file:

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

5.megabytes is 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 to your Gemfile:

gem 'rails_log_autotruncator'

Rails 2 Without Bundler

do:

gem install rails_log_autotruncator

then write the following to your environment.rb to Rails::Initializer.run block:

config.gem “rails_log_autotruncator”, :lib => “rails_log_autotruncator”

Copyright

Copyright © 2011 Dmitry Plashchynski. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.