On some of my rails application pages I am seeing reams and reams of information echoed out to the console, messages that I am not interested in such as http messages:
Started GET "/assets/jquery_ui/jquery-ui-1.8.16.custom.css?body=1" for 10.0.2.2 at 2012-03-02 15:19:59 +0000
Served asset /jquery_ui/jquery-ui-1.8.16.custom.css - 304 Not Modified (0ms)
There is also lots of SQL statements that I don't normally care about.
Sure, I can see how sometimes this level of information would be helpful sometimes. But I would like to run my server normally without this noise.
The reason for this is because if I am debugging an issue, I like to explicitly log messages to the console, run the request and observe the output. However finding my own logs in amongst this noise is time consuming!
Currently to work around this I am marking my messages with a magic string and greping the output to the console...
Can anybody suggest a nicer way to reduce the console output to just my own messages?
I am on rails 3.1.
Thanks for any suggestions.
To exit the console, type: quit .
Rails makes use of the ActiveSupport::Logger class to write log information. Other loggers, such as Log4r , may also be substituted. You can specify an alternative logger in config/application.rb or any other environment file, for example: config. logger = Logger.
The console command lets you interact with your Rails application from the command line. On the underside, bin/rails console uses IRB, so if you've ever used it, you'll be right at home. This is useful for testing out quick ideas with code and changing data server-side without touching the website.
One of the things rails server does is that it loads all the dependencies/gems required by your Rails app, or at least sets them up to be auto-loaded later when they are needed. This is sometimes called "booting" or loading the "Rails environment".
You can raise the logging level in config/environments/development.rb from info to warn
http://guides.rubyonrails.org/debugging_rails_applications.html#log-levels
Add Quiet Assets to the development group of your Gemfile.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With