I have set Save Log, Days to 15 days. However, I checked my log tables (e.g. log_customer), there are a lot of very old entries, back to 2010. I manually run log.php from shell - php -f log.php clean --days 1

Those old entries are still there afterwards. Any idea?


Looks like only the following log tables not cleaned:

log_customer report_viewed_product_index report_compared_product_index report_event catalog_compare_item

They all have very old entries. Is there any purpose for this? Can I truncate them safely?

  • please read this blog docs.nexcess.net/article/magento-database-maintenance.html
    – Keyul Shah
    Commented Jan 17, 2015 at 5:10
  • Yes I read that. But I want to know if magento's built-in log cleaning is working or not. If not, why?
    – Shawn
    Commented Jan 17, 2015 at 18:38
  • If magento will launch the product then definalty they are not launch product of bug. Its working.
    – Keyul Shah
    Commented Jan 18, 2015 at 3:34

1 Answer 1


So by default Magento should clean the following using the basic clean code:

  1. Customers,
  2. Visitors,
  3. Urls,

See the code:


Though there is a before and after clean events which means that either you can clean custom tables or Magento itself can hook in here for an each deep clean. See the following functions for extra items that are cleaned.

  1. catalogProductCompareClean
  2. eventClean

What this all boils down to is that Magento should clean the tables:

  1. $this->getTable('log/visitor')
  2. $this->getTable('log/customer')
  3. $this->getTable('log/url_info_table')
  4. $this->getTable('log/quote_table')
  5. $this->getTable('log/url_table')
  6. $this->getTable('log/visitor_info')

Plus the two items that are hooked onto the after event. If these tables are not being cleaned then I would step into these functions and check why they are not.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.