# Keeping the size of log files

**URL:** <https://www.ruby-forum.com/t/keeping-the-size-of-log-files/140261>\
**Category:** Rails\
**Created:** [June 12, 2008, 11:32am UTC](https://www.ruby-forum.com/t/keeping-the-size-of-log-files/140261 "2008-06-12T11:32:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![T\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e0b2c6/32.png) [@T\_K](https://www.ruby-forum.com/u/T_K)\
**Post date:** [June 12, 2008, 11:32am UTC](https://www.ruby-forum.com/t/keeping-the-size-of-log-files/140261/1 "2008-06-12T11:32:09Z")

</div>

Hi,

During development, I see the size of development.log / test.log is  
increasing forever. Is it possible to set the limit of the size?

I see that I can run `rake log:clear` occasionally, but I just wanna  
ignore the files where possible.

-T

---

<div class="post-metadata">

**Author:** ![T\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e0b2c6/32.png) [@T\_K](https://www.ruby-forum.com/u/T_K)\
**Post date:** [June 12, 2008, 5:20pm UTC](https://www.ruby-forum.com/t/keeping-the-size-of-log-files/140261/2 "2008-06-12T17:20:50Z")

</div>

You could always just have rake log:clear run automatically every so  
often using a cronjob. That way you can ignore them, and they won’t get  
too big.

For info on cronjobs:

[http://www.aota.net/Script\_Installation\_Tips/cronhelp.php3](http://www.aota.net/Script_Installation_Tips/cronhelp.php3)

[http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial#do\_stuff](http://www.railsenvy.com/2007/6/11/ruby-on-rails-rake-tutorial#do_stuff)

The second link is actually mostly about rake tasks, but its got a great  
example of how to run a rake task with a cronjob.

Of course, there’s probably some better solution than mine, which I’m  
sure someone else will post 🙂
