Who said size is not important?
Liquid error: undefined method `login' for nil:NilClass : December 14th, 2005
If you want to make sure your logs won't fill up the /var partition, you should rotate your logs on _size_ instead of _time_. Add this to the Rails::Initializer.run block in environment.rb to keep 50 old logfiles of 1MB each:
config.logger = Logger.new("#{RAILS_ROOT}/log/#{ENV['RAILS_ENV']}.log", 50, 1048576)
3 Responses to “Who said size is not important?”
Leave a Reply
Remember: escape your underscores \_ and indent code at least 4 spaces or incur the wrath of smartypants.
December 16th, 2005 at 09:43 PM Thanks for the tip! 1.megabyte instead of 1048576 is nicer :)
December 18th, 2005 at 02:53 PM except active support isn't loaded yet, so you get "undefined method `megabyte' for 1:Fixnum (NoMethodError)" or something...
January 8th, 2006 at 04:59 AM Even better is to use *config.log_path* to get the configured or default log file name.