×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: bejoy balan
Added: Aug 28, 2017 7:41 AM
Views: 3
http://www.axertion.com/tutorials/2012/12/how-to-disable-magento-logging-to-the-database/
  1. Magento does some excessive logging to track customers. This in return causes your Magento database to expand exponentially in size, and inevitably decreases your sites overall performance.
  2.  
  3. I found that disabling logging from the Magento admin does not stop Magento from writing to the log tables in the database. To tell Magento to completely stop, do the following.
  4.  
  5. 1. Open your app/etc/local.xml file
  6. 2. Paste in the following, right before the </config> closing tag:
  7. <frontend>
  8.     <events>
  9.         <controller_action_predispatch>
  10.             <observers><log><type>disabled</type></log></observers>
  11.         </controller_action_predispatch>
  12.         <controller_action_postdispatch>
  13.             <observers><log><type>disabled</type></log></observers>
  14.         </controller_action_postdispatch>
  15.         <customer_login>
  16.             <observers><log><type>disabled</type></log></observers>
  17.         </customer_login>
  18.         <customer_logout>
  19.             <observers><log><type>disabled</type></log></observers>
  20.         </customer_logout>
  21.         <sales_quote_save_after>
  22.             <observers><log><type>disabled</type></log></observers>
  23.         </sales_quote_save_after>
  24.         <checkout_quote_destroy>
  25.             <observers><log><type>disabled</type></log></observers>
  26.         </checkout_quote_destroy>
  27.     </events>
  28. </frontend>
  29. 3. Save your local.xml file
  30.  
  31. 4. Now to go System > Configuration > Advanced and set Mage_Log to Disable
  32.  
  33. 5. Finally, flush your Magento caches under System > Cache Management
  34.  
  35. Magento should no longer write logs to these tables.
  36.  
  37. To clean out your existing log tables, just run the following SQL command against your Magento database.
  38.  
  39. WARNING: Once you truncate these tables, the log information will be permanently lost. If you have no need for this log data, then by all means get rid of it!
  40. TRUNCATE log_customer;
  41. TRUNCATE log_quote;
  42. TRUNCATE log_summary;
  43. TRUNCATE log_summary_type;
  44. TRUNCATE log_url;
  45. TRUNCATE log_url_info;
  46. TRUNCATE log_visitor;
  47. TRUNCATE log_visitor_info;
  48. TRUNCATE log_visitor_online;
  49. TRUNCATE report_event;