Thursday, October 11, 2012

Empty log file for Apache on Mac

Sometimes the error log and the access log get a bit out of hand when developing.
To wipe the contents of the error log or the access log in Apache on MacOS. Open terminal and run the following commands:

sudo apachectl stop

cd /var/log/apache2/

sudo newsyslog error_log

sudo newsyslog access_log

Then delete the old ones if you need the disk space back:

sudo rm error_log.0

sudo rm access_log.0

You can then start apache again:

sudo apachectl stop

No comments:

Post a Comment