Skip to content

Instantly share code, notes, and snippets.

@tinomen
Created October 23, 2010 05:00
Show Gist options
  • Save tinomen/641813 to your computer and use it in GitHub Desktop.
Save tinomen/641813 to your computer and use it in GitHub Desktop.
setup logger to rotate
#----------------------------------------------------------------------------
# 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