I'm troubleshooting a php log file that has expanded way too rapidly and used up a lot of disk space.
What is the best way to clear a log file?
is it a problem to simply delete the log file? And will that log file be recreated as php tries to write to it?
It is entirely safe to just delete the php.log file. It will be auto-created the next time it is needed.
On Linux you can do :
cat /dev/null > /var/logs/php.log
On Mac OS X 10.6 I deleted /var/log/apache2/error_log. Minor panic when it didn't re-appear upon refreshing my page. Just had to restart apache by going through the Sharing settings. Now she's back.
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