Make it Possible to Disable the Admin Log for TomatoCart

In TomatoCart admin panel, you could check the admin log under Start Menu > Tools > Admin Log.

mainIt may be useful for some store owner to check the administrator activity. The problem is that if there are a lot of products in your store, the data inserted into the log database table is so huge. Obviously, it will impact the performance of your database. One user had complained the problem as below:

Our store contains more than 20k+ products. We update ALL these products about twice or more per week. When I import 20k+ products or update state of the products admin log grows as hell.

So, we have to make it possible to disable the admin log for some stores.  The better way is to add a configuration for it under Configuration > My Store as follow:

configAs you can see, the store owner just need to set the Enable administrators log to false to disable that feature.

Integration Guide

Step 1. You have to add the following sql into your database:

NSERT INTO toc_configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) VALUES ('Enable administrators log', 'ENABLE_ADMINISTRATORS_LOG', '1', 'Set to true if you want to see the logs in the administrators log module', '1', '28', 'osc_cfg_use_get_boolean_value', 'osc_cfg_set_boolean_value(array(1, -1))', now());

Step 2. Go to includes/classes/database.php

– Find the following code in it:

function setLogging($module, $id = null) {
        $this->logging = true;

        $this->logging_module = $module;
        $this->logging_module_id = $id;
}

– Replace the above code with the following code:

function setLogging($module, $id = null) {
     if (defined('ENABLE_ADMINISTRATORS_LOG') &&  ENABLE_ADMINISTRATORS_LOG == '1') {
        $this->logging = true;
     }

     $this->logging_module = $module;
     $this->logging_module_id = $id;
 }

Step 3. Go to admin panel > Start Menu > Tools > Cache Control module to clear the configuration cache.

cacheOkay now. You could disable the admin log module in the my store configuration panel.

If you can’t add it for your store by yourself, contact us to get technical support via email support@tomatocart.com

Looking for quality TomatoCart Web Hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , | Posted under TomatoCart | RSS 2.0

Author Spotlight

Jack Yin

Jack Yin

TomatoCart Developer & Co Founder - Arvixe Web Hosting / TomatoCart Community Liaison

Leave a Reply

Your email address will not be published. Required fields are marked *


5 × 8 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>