I stumbled to learn that my rails3.1 log file is super large, around 21mb. Is this, in terms of size normal? What the log file would like in the production environment? Besides, can I get rid of the log?thanks
相关问题
- Question marks after images and js/css files in ra
- Using :remote => true with hover event
- Eager-loading association count with Arel (Rails 3
- I want to trace logs using a Macro multi parameter
- Is there a way to remove IDV Tags from an AIFF fil
相关文章
- how do I log requests and responses for debugging
- Right way to deploy Rails + Puma + Postgres app to
- AWS S3 in rails - how to set the s3_signature_vers
- how to call a active record named scope with a str
- How to add a JSON column in MySQL with Rails 5 Mig
- “No explicit conversion of Symbol into String” for
- form_for wrong number of arguments in rails 4
- Rspec controller error expecting <“index”> but
You may want to use
logrotate
. Have a look at the answer to this question: Ruby on Rails production log rotation.According to the documentation, if you want to limit the size of the log folder, put this in your 'development.rb'-file:
With this, your log files will never grow bigger than 50Mb. You can change the size to your own preference. The ‘1’ in the second parameter means that 1 historic log file will be kept, so you’ll have up to 100Mb of logs – the current log and the previous chunk of 50Mb.
The
log
folder of your Rails application holds three log files corresponding to each of the standard environments. Log files can grow very large over time. Arake task
is provided to allow the easy clearing of the log files.A fair compromise, in an initializer:
Yes, You can using syntax like this:
Example:
It not only using for Rails log, you can using log file of any services run with rails, such as: rpush log, ...
config.logger = ActiveSupport::Logger.new(nil)
does the trick and completely disables logging to a file (console output is preserved).