Skip to content

Instantly share code, notes, and snippets.

@johnkferguson
Created January 12, 2014 19:48
Show Gist options
  • Save johnkferguson/8389494 to your computer and use it in GitHub Desktop.
Save johnkferguson/8389494 to your computer and use it in GitHub Desktop.
How to configure Rails to rotate your log files

To configure Rails to rotate your log files while in the development and test environments, add the following to your development.rb and test.rb files found within /config/environments/

# Keeps the Last 5 logfiles which are rotated at every 5MB
config.logger = Logger.new("#{Rails.root}/log/#{ENV['RAILS_ENV']}.log", 5, 5242880)

Found on Stack Overflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment