Tidying Magento Logs

Posted by: Karen Saturday, August 21st, 2010

Many people don’t seem to worry about their logs increasing until their site falls over.  Probably not too wise….

Here are some things you can do to have a bit of a tidy up:

  1. Delete /var/cache occassionally, it does build up rubbish in here, and refreshing from admin doesn’t completely clear it out
  2. Check /var/reports for errors – your customer is seeing these.  Removing then looking again a few days later gives you clues about current issues
  3. Make sure system logging is switched off – in Admin under System->Configuration->Developer->Log Settings
  4. Switch on automated log cleaning using Cron – in Admin under System->Configuration->System, by default this is switched off

If you want to have a big clear out then remove your log files manually from the database via phpmyadmin. EMPTY all the tables beginning with log_ . This isn’t for the faint-hearted, touching the database is always risky so make sure you take a backup.  Optionally you can optimise the tables afterwards.

You’ll be surprised about the amount of space you will recover on your disk if you have never done this. On a busy site you need to be setting the cleaning schedule to every few days.

Comments are closed.