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?


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, privacy policy and cookie policy

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