# Logfile rotate

**URL:** <https://www.ruby-forum.com/t/logfile-rotate/165239>\
**Category:** Ruby\
**Created:** [April 10, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/logfile-rotate/165239 "2009-04-10T16:46:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bloodniece](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bloodniece](https://www.ruby-forum.com/u/bloodniece)\
**Post date:** [April 10, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/logfile-rotate/165239/1 "2009-04-10T16:46:19Z")

</div>

Is there a gem that rolls logs for you? if so how and where can I get  
it? I have started to write my own, but figured I’d ask.

thx!

---

<div class="post-metadata">

**Author:** ![bloodniece](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bloodniece](https://www.ruby-forum.com/u/bloodniece)\
**Post date:** [April 10, 2009, 4:56pm UTC](https://www.ruby-forum.com/t/logfile-rotate/165239/2 "2009-04-10T16:56:31Z")

</div>

On Apr 10, 2009, at 8:46 AM, Derek S. wrote:

> Is there a gem that rolls logs for you? if so how and where can I get  
> it? I have started to write my own, but figured I’d ask.

Take a look at the “logging” gem. It has a rolling logfile appender –  
rotates logfiles after they get (a) too big or (b) too old. If you are  
not generating the logfiles from a Ruby app, then that appender is a  
good place to steal code from.

Blessings,  
TwP

---

<div class="post-metadata">

**Author:** ![bloodniece](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/47e85d/32.png) [@bloodniece](https://www.ruby-forum.com/u/bloodniece)\
**Post date:** [April 12, 2009, 2:42pm UTC](https://www.ruby-forum.com/t/logfile-rotate/165239/3 "2009-04-12T14:42:17Z")

</div>

There is also a standard Ruby library called Logger which can do that:  
[http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/index.html](http://www.ruby-doc.org/stdlib/libdoc/logger/rdoc/index.html)

Derek S. wrote:

> Is there a gem that rolls logs for you? if so how and where can I get  
> it? I have started to write my own, but figured I’d ask.
> 
> thx!
