Clearing Magento Log Data

前端 未结 15 605
粉色の甜心
粉色の甜心 2020-12-07 08:31

I have a question regarding clearing of the log data in Magento.

I have more than 2.3GB of data in Magento 1.4.1, and now I want to optimize the database, because it

相关标签:
15条回答
  • 2020-12-07 09:26
    SET foreign_key_checks = 0;
    TRUNCATE dataflow_batch_export;
    TRUNCATE dataflow_batch_import;
    TRUNCATE log_customer;
    TRUNCATE log_quote;
    TRUNCATE log_summary;
    TRUNCATE log_summary_type;
    TRUNCATE log_url;
    TRUNCATE log_url_info;
    TRUNCATE log_visitor;
    TRUNCATE log_visitor_info;
    TRUNCATE log_visitor_online;
    TRUNCATE report_viewed_product_index;
    TRUNCATE report_compared_product_index;
    TRUNCATE report_event;
    TRUNCATE index_event;
    SET foreign_key_checks = 1;
    
    0 讨论(0)
  • 2020-12-07 09:28

    No need to do this yourself, the Magento system has a built-in for cleaning up log information. If you go to

    System > Configuration > Advanced > System > Log Cleaning
    

    You can configure your store to automatically clean up these logs.

    0 讨论(0)
  • 2020-12-07 09:31

    After clean the logs using any of the methods described above you can also disable them in your app/etc/local.xml

    ...
    <frontend>
    <events>
     <frontend>
      <events>
        <!-- disable Mage_Log -->
        <controller_action_predispatch>
            <observers><log><type>disabled</type></log></observers>
        </controller_action_predispatch>
        <controller_action_postdispatch>
            <observers><log><type>disabled</type></log></observers>
        </controller_action_postdispatch>
        <customer_login>
          <observers>
            <log>
              <type>disabled</type>
            </log>
          </observers>
        </customer_login>
        <customer_logout>
          <observers>
            <log>
              <type>disabled</type>
            </log>
          </observers>
        </customer_logout>
        <sales_quote_save_after>
           <observers>
              <log>
                  <type>disabled</type>
              </log>
            </observers>
       </sales_quote_save_after>
       <checkout_quote_destroy>
         <observers>
           <log>
             <type>disabled</type>
           </log>
         </observers>
       </checkout_quote_destroy>
    </events>
    </frontend>
    </config>
    
    0 讨论(0)
  • 2020-12-07 09:32

    Cleaning the Magento Logs using SSH :

    login to shell(SSH) panel and go with root/shell folder.

    execute the below command inside the shell folder

    php -f log.php clean
    

    enter this command to view the log data's size

    php -f log.php status

    This method will help you to clean the log data's very easy way.

    0 讨论(0)
  • 2020-12-07 09:32

    How Magento log cleaning can be done both manually, automatically and other Magento database maintenance. Below the three things are most important of Magento database maintenance and optimization techniques;

    • Log Cleaning
    • Smart use of MySQL updated versions
    • Buffer pool size settings

    To get more information http://blog.contus.com/magento-database-maintenance-and-optimization/

    0 讨论(0)
  • 2020-12-07 09:33
    SET FOREIGN_KEY_CHECKS=0;
    TRUNCATE dataflow_batch_export;
    TRUNCATE dataflow_batch_import;
    TRUNCATE log_customer;
    TRUNCATE log_quote;
    TRUNCATE log_summary;
    TRUNCATE log_summary_type;
    TRUNCATE log_url;
    TRUNCATE log_url_info;
    TRUNCATE log_visitor;
    TRUNCATE log_visitor_info;
    TRUNCATE log_visitor_online;
    TRUNCATE report_viewed_product_index;
    TRUNCATE report_compared_product_index;
    TRUNCATE report_event;
    TRUNCATE index_event;
    SET FOREIGN_KEY_CHECKS=1;
    
    0 讨论(0)
提交回复
热议问题