Created
October 23, 2010 05:00
-
-
Save tinomen/641813 to your computer and use it in GitHub Desktop.
setup logger to rotate
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------------------------------- | |
# Rotate log files (50 files max at 1MB each) | |
#---------------------------------------------------------------------------- | |
log_path = '#{Rails.root}/log/#{Rails.env}.log' | |
gsub_file 'config/application.rb', /(< Rails::Application.*)/ , "\\1\n config.logger = | |
Logger.new(\"#{log_path}\", 50, 1048576)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment