# Viewing Rails log files

**URL:** <https://www.ruby-forum.com/t/viewing-rails-log-files/137667>\
**Category:** Rails\
**Created:** [May 15, 2008, 4:46am UTC](https://www.ruby-forum.com/t/viewing-rails-log-files/137667 "2008-05-15T04:46:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikrant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/cc9497/32.png) [@vikrant](https://www.ruby-forum.com/u/vikrant)\
**Post date:** [May 15, 2008, 4:46am UTC](https://www.ruby-forum.com/t/viewing-rails-log-files/137667/1 "2008-05-15T04:46:58Z")

</div>

Hi,  
Presently, to view the log files I simply open it in my text editor,  
but after sometime when the size of the log files crosses some  
megabytes, my text editor starts to hang.  
A solution may be to always truncate the log file length to zero bytes  
after a time period.  
This method surely works for development log files but is not suitable  
for production log files, where I don’t want to truncate the log files  
to zero very often.  
I wanted to ask, is there any plugin or gem which let me see the log  
files directly from my browser? (with authentication and all)

At last. Is it a “good idea” and is there any plugin/gem which dumps  
the log to database instead of file?

---

<div class="post-metadata">

**Author:** ![vikrant](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/cc9497/32.png) [@vikrant](https://www.ruby-forum.com/u/vikrant)\
**Post date:** [May 15, 2008, 5:51am UTC](https://www.ruby-forum.com/t/viewing-rails-log-files/137667/2 "2008-05-15T05:51:51Z")

</div>

Typically, the approach is to have some sort of schedule job (or use  
logrotate) to rotate your log files each day - you keep an archive of  
past days, but your current production.log will only have 24 hours or  
less. See [http://wiki.rubyonrails.org/rails/pages/DeploymentTips](http://wiki.rubyonrails.org/rails/pages/DeploymentTips). Of  
course if you have a busy site that might not solve your problem. So  
you will be better using commands like tail and grep to search your  
log.

I haven’t come across anything storing your log in the database.

HTH,  
Nicholas
