Ruby on rails log file size too large

Jason picture Jason · Oct 16, 2011 · Viewed 25.5k times · Source

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

Answer

Raj Adroit picture Raj Adroit · Mar 17, 2013

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. A rake task is provided to allow the easy clearing of the log files.

rake log:clear
# Truncates all *.log files in log/ to zero bytes 
# Specify which logs with LOGS=test,development,production