Need help?

Our experts have had an average response time of 13.14 minutes in February 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

Disable visitor log in Magento – Simple way to speed up your website

by | Mar 11, 2019

A bulky Magento database can always pull down the performance of your websites.

Therefore, server owners sometimes disable visitor log in Magento to improve the database performance.

At Bobcares, we help website owners optimize their Magento website applications as part of our Dedicated Support Services.

Today, let’s see how our Support Experts disable visitor log in Magento.

Disable visitor log in Magento – Why it’s needed?

Magento, by default, has an extensive logging system. In other words, it logs all the user activity information to the database. This is useful, because it helps website owners analyze the behavior and activities of their customers.

Magento has a Mage_Log module that stores the log data of visitors. It mainly stores information such as current visitors, visitor IP address, first visit, last visit, etc. However, Magento database size eventually grows, which in turn causes disk space issues and reduces the overall performance of the website.

In such cases, we need to disable logging in Magento. However, this has many disadvantages. One such major problem is that the product comparing doesn’t work correctly if we disable visitor log.

So, our Support Engineers recommend customers to disable visitor log in Magento if they use any external services such as Google Analytics. Customers usually disable visitor logging from System > Configuration > Advanced > System > Log > Enable Log in Magento admin panel.

magento disable visitor log

How to disable Logging in Magento?

 

However, we’ve seen instances where this doesn’t become successful and Magento still writes information to the log tables.

Disable visitor log in Magento – How to do it?

Now, let’s see the different methods used by our Support Engineers to disable visitor log in Magento.

1) Disable logging in Local configuration file

Our Support Engineers disable the visitor log by adding the following code before in the configuration file app/etc/local.xml.




disabled


disabled


disabled


disabled


disabled


disabled


 

Further, we make sure to disable Mage_log module from System > Configuration > Advanced and flush the Magento cache from System > Cache Management in Magento admin panel.

Then, Magento will no longer write logs to the tables. To clear the existing log information, our Support Experts manually truncate the log tables. For example, we truncate the log_customer and log_visitor tables using the below command.

TRUNCATE log_customer;
TRUNCATE log_visitor;

 

Alternatively, we clear these log tables from phpMyAdmin control panel also. But, note that once we truncate the tables, all the log data will be permanently lost. So, we always confirm with the customers before clearing these tables.

2) Magento Extensions

Likewise, we can disable visitor log using Magento extensions as well. Our Support Experts ask customers to use Magento extensions such as DisableLog. We disable the logs for all the requests being made or for search bots.

For shops with bulky databases, this can reduce the update/insert queries thereby improving load times of the website.

For example, to completely disable logging using DisableLog extension, we set the parameter Disable All Logs to Yes. This disables the logs for users requests and search bots.

3) Modify the Core model

Similarly, another method to disable visitor log in Magento is to edit the Mage_Log core model. Our Support Engineers add/modify the below line as follows in the file /app/code/local/Mage/Log/Model/Visitor.php.

protected $_skipRequestLogging = true;

Most importantly, we backup this file before making any changes. Also, modifying the modules in Magento is not recommended.

4) Enable log rotation

Customers can also clear the Magento logs manually using the shell utility log.php. This will take some time depending on the size of the logs.

php -f shell/log.php clean

 

However, this requires shell access(SSH access) for the customer. That’s why our Support Engineers suggest the option of automatic Magento log cleaning. This leaves the log data in place, but the database won’t become too large with the log entries. We enable automatic log cleaning using the below steps.

  • Go to System > Configuration > Advanced > System > Log cleaning.
  • Change Enable Log Cleaning to Yes.
  • Set Save Log field to small values such as 1 or  2 days.
  • Click Save Config.

 

magento disable visitor log

How to enable Log rotation in Magento?

 

The automatic log clearing will happen through a Magento cron job. So, our Magento Experts ensure that proper cron jobs are in place to do this process.

[Need an expert to resolve the performance issues of your Magento website? Our Magento Experts can help you here.]

Conclusion

In short, customers disable visitor logs in Magento to improve the website performance. Today, we’ve discussed the top 4 methods used by our Dedicated Support Engineers to disable database logging in Magento.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

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

Categories

Tags

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF