I stumbled to learn that my rails3.1 log file is super large, around 21mb. Is this, in terms of size normal? What the log file would like in the production environment? Besides,
you can just delete the file!
Rails will create a new log if one doesn't exist.
Obviously save / backup the file if it's important, but usually it's not.
You can also zip the backuped up file (and then delete the source) if you want to keep it on the same drive but still save space.
To automatically rotate log files (the best long-term solution) use log rotate as described here:
Ruby on Rails production log rotation
then you can set it and forget it!
To actually change what gets logged see:
http://dennisreimann.de/blog/silencing-the-rails-log-on-a-per-action-basis/
config.logger = ActiveSupport::Logger.new(nil)
does the trick and completely disables logging to a file (console output is preserved).
A fair compromise, in an initializer:
Rake::Task['log:clear'].invoke if Rails.env.development? || Rails.env.test?