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! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
open config/environments/development.rb and you''ll see instantly how you can turn off logging ;-) On Mar 24, 12:31 pm, jen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 ========================================================= -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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... On Mar 25, 12:58 pm, jen <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> 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 > =========================================================> > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, Eden! I''ll try that. The reason I wanted to temorarily disable logging was cuz the log files were getting huge in size. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks, Fred. I''m going to try both the suggestions and hopefully it''ll reduce the size of the log files! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Reasonably Related Threads
- [PATCH] remove rails2.3 deprecated config.action_view.cache_template_extensions
- ActionMailer dont function with JRuby?
- See Rails::Configuration for more options?
- config.cache_classes true or false in test environment?
- Getting rspec error: Net::SMTPServerBusy: Relay access denied