The best way to handle this is to stop the application so you can remove the offending logs, or compress them, then restart the application. But in a production environment you may not be able to stop the application whenever you want.
So, desperate times call for desperate measures. Whack that log file without affecting the application's ability to write to it.
cat /dev/null > /var/app/logfile
...and the app will keep on ticking while you breathe a sigh of relief and set up logrotate!

No comments:
Post a Comment