# Rails Development Log

**URL:** <https://www.ruby-forum.com/t/rails-development-log/89960>\
**Category:** Rails\
**Created:** [March 24, 2007, 5:31am UTC](https://www.ruby-forum.com/t/rails-development-log/89960 "2007-03-24T05:31:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jen](https://www.ruby-forum.com/u/jen)\
**Post date:** [March 24, 2007, 5:31am UTC](https://www.ruby-forum.com/t/rails-development-log/89960/1 "2007-03-24T05:31:34Z")

</div>

Hi,  
I am using Ruby+Rails with Mongrel.  
Is there any way to disable logging so that everytime I start rails  
(mongrel\_rails start), it doesn’t automatically start logging info to  
development.log  
Thanks!

---

<div class="post-metadata">

**Author:** ![jen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jen](https://www.ruby-forum.com/u/jen)\
**Post date:** [March 25, 2007, 5:35am UTC](https://www.ruby-forum.com/t/rails-development-log/89960/2 "2007-03-25T05:35:22Z")

</div>

open config/environments/development.rb and you’ll see instantly how  
you can turn off logging 😉

---

<div class="post-metadata">

**Author:** ![jen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jen](https://www.ruby-forum.com/u/jen)\
**Post date:** [March 25, 2007, 9:53pm UTC](https://www.ruby-forum.com/t/rails-development-log/89960/3 "2007-03-25T21:53:10Z")

</div>

Oh sorry about that. I thought it would be sticking out like a sore  
thumb, but apparently it’s not very easy to turn off logging. You can  
turn it down.

Here’s a hack I came up with that seems to work on my machine, but I  
don’t know if I’d put this into production. Add this line to the  
environment file you want to turn off logging for:

config.logger = Object.new.instance\_eval { def method\_missing(\*m);  
end; self }

It sets the logger to a dead, do nothing object. Setting logger to  
nil and just a plain old Object.new don’t work – this one does  
though…

---

<div class="post-metadata">

**Author:** ![jen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jen](https://www.ruby-forum.com/u/jen)\
**Post date:** [March 25, 2007, 6:58am UTC](https://www.ruby-forum.com/t/rails-development-log/89960/4 "2007-03-25T06:58:24Z")

</div>

Thanks, Eden.  
I took a look at that file but couldn’t find an option that would turn  
off logging (i know i’m probably dumb 🙂 and it must be something  
straightforward!)

Anyway I’m copying the config/environments/development.rb file below…  
maybe you could take a look and give some guidance? Thanks for your  
help!!!

===========================================

# Settings specified here will take precedence over those in

config/environment.rb

# In the development environment your application’s code is reloaded on

# every request. This slows down response time but is perfect for

development

# since you don’t have to restart the webserver when you make code

changes.  
config.cache\_classes = false

# Log error messages when you accidentally call methods on nil.

config.whiny\_nils = true

# Enable the breakpoint server that script/breakpointer connects to

config.breakpoint\_server = true

# Show full error reports and disable caching

config.action\_controller.consider\_all\_requests\_local = true  
config.action\_controller.perform\_caching = false  
config.action\_view.cache\_template\_extensions = false  
config.action\_view.debug\_rjs = true

# Don’t care if the mailer can’t send

# config.action\_mailer.raise\_delivery\_errors = false

---

<div class="post-metadata">

**Author:** ![jen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jen](https://www.ruby-forum.com/u/jen)\
**Post date:** [March 26, 2007, 10:08am UTC](https://www.ruby-forum.com/t/rails-development-log/89960/5 "2007-03-26T10:08:50Z")

</div>

Alternatively stick  
config.log\_level = :info  
into your development.rb file (see  
[http://glu.ttono.us/articles/2006/05/22/configuring-rails-environments-the-cheat-sheet](http://glu.ttono.us/articles/2006/05/22/configuring-rails-environments-the-cheat-sheet)  
for info on what some of the other things there do).

This will filter out a lot of the stuff in the log (eg you won’t see all  
SQL queries made any more) but you’ll still be able to see what requests  
are being made and so on. You can crank it up even higher if you only  
want to see errors, by setting config.log\_level to :error

Fred

---

<div class="post-metadata">

**Author:** ![jen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jen](https://www.ruby-forum.com/u/jen)\
**Post date:** [March 26, 2007, 7:06am UTC](https://www.ruby-forum.com/t/rails-development-log/89960/6 "2007-03-26T07:06:57Z")

</div>

Thanks, Eden! I’ll try that. The reason I wanted to temorarily disable  
logging was cuz the log files were getting huge in size.

---

<div class="post-metadata">

**Author:** ![jen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecae2f/32.png) [@jen](https://www.ruby-forum.com/u/jen)\
**Post date:** [March 27, 2007, 6:32am UTC](https://www.ruby-forum.com/t/rails-development-log/89960/7 "2007-03-27T06:32:28Z")

</div>

Thanks, Fred. I’m going to try both the suggestions and hopefully it’ll  
reduce the size of the log files!
