"how to delete rails log file after certain size" Code Answer
2
the best way is to set up log rotation, but how you do this is very platform dependent,
so you should add a comment about what you're using, both for development and production.
for our apps running on linux, we have a file /etc/logrotate.d/appname for each app,
that looks something like this:
the best way is to set up log rotation, but how you do this is very platform dependent, so you should add a comment about what you're using, both for development and production.
for our apps running on linux, we have a file /etc/logrotate.d/appname for each app, that looks something like this:
this will move the log into a new file once a day, keeping a compressed backup file for each of the last 7 days.
if you just want to empty the file without keeping any of the data in it while the daemon is running, simply do this from a shell:
this will truncate the file to 0 bytes length.