config.logger = Logger.new(config.log_path, 3, 10 * 1024**2)
Logfiles can get 10mb big, than they will be renamed to e.g. production.log.0 and if there are more than 3 of them they get deleted.
Maximum filesystem usage: 30mb
An alternative is using logrotate which is a harder to setup and maintain, but offers more options.

4 comments
Comments feed for this article
March 3, 2009 at 18:17
Will Sargent
If you use the logging gem at http://logging.rubyforge.com, you can use the RollingFileAppender.
March 3, 2009 at 18:33
pragmatig
I am pretty satisfied with Rails logging as it is, now that my logfiles size is limited, but ill have a look what the logging gem can do for me
March 25, 2009 at 23:54
John Dewey
I believe if you use this approach with mongrel, your mongrels will all try to rotate the file at the same time, causing all but the first mongrel to rotate the log to indefinitely block (lock up).
John
March 26, 2009 at 8:03
pragmatig
sounds possible, but so far we did not encounter the problem and i hope the logger developers too care of it since it is an obvious problem.