Forums

Big error (72 mb) and server log, but it isnt been rotated

Hi,

I have a problem with my error logs, they are to big to load. But i cant rename them or delete them. So i can't debug the problem. Can some point me at the best direction?

Kind regards,

Jos

They should be rotated daily, so the problem will normally resolve quickly (though I think there might have been an issue with rotation last night for some log files).

However, in the meantime, if you don't care about the existing contents, you can empty them (rather than deleting them) from Bash. Let's say the log you want to clear is /var/log/www.yourdomain.com.access.log -- you can do this to reset it to empty:

echo > /var/log/www.yourdomain.com.access.log

This is because, while you don't have permissions to delete it, you do have permissions to write to it -- so that command just writes an empty string into it.

Another useful trick: even if you can't open the log file in the web interface due to its size, you can use Bash tools to look at it:

 less /var/log/www.yourdomain.com.access.log

...will drop you into the Linux "less" tool -- if you're not familiar with it, Google will have good information.

Thank you, i will try that.

yep is worked, thanks a lot.

Great, thanks for confirming!