dmlab / module-disable-log
Per-source admin toggles to disable Magento's high-frequency core logging: customer login/logout log, online-visitor tracking and search-query stats. Default off — installing changes nothing.
Package info
github.com/dmlab-work/module-disable-log
Type:magento2-module
pkg:composer/dmlab/module-disable-log
Requires
- php: ~8.2.0||~8.3.0||~8.4.0||~8.5.0
- magento/framework: ^103.0.7
- magento/module-config: ^101.2.7
- magento/module-customer: ^103.0.7-p9
- magento/module-reports: ^100.4.7
- magento/module-search: ^101.1.7
Requires (Dev)
- phpunit/phpunit: ^11.5||^12.5
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Per-source admin toggles to switch off Magento's high-frequency core logging.
Unlike Yireo DisableLog2, it also switches off search-term logging (search_query), next to customer logins and online visitors.
Magento writes to the database on ordinary page loads for all three, and those tables keep growing.
Switch each source off from the admin; nothing changes until you do.
With visitor tracking off, a password change or reset still logs out the customer's other sessions.
Install
composer require dmlab/module-disable-log bin/magento module:enable DmLab_DisableLog bin/magento setup:upgrade
Requirements
Magento 2.4.7-p9+ · PHP 8.2–8.5
2.4.7-p9 is the first 2.4.7 release that keeps the login time in the customer session, which the session validator needs.
Configuration
Stores → Configuration → DMLab → Disable Log (default scope, ACL DmLab_DisableLog::config).
| Toggle | Config path | Stops |
|---|---|---|
| Disable Customer Login/Logout Log | dmlab_disable_log/general/disable_customer_log |
customer_log writes (last login/logout times) |
| Disable Online Visitor Tracking | dmlab_disable_log/general/disable_visitor_log |
customer_visitor writes |
| Disable Search Query Log | dmlab_disable_log/general/disable_search_log |
search_query writes (new terms, popularity, result counts) |
All toggles default to No, are independent and reversible, and apply to every area (storefront, admin, API):
bin/magento config:set dmlab_disable_log/general/disable_visitor_log 1
Side effects
- Customer log — "Last Logged In" and online status in the admin customer view stop updating.
- Visitor tracking — Customers → Now Online stays empty; guest "Add to Compare" stops working;
guest recently viewed/compared rows without a visitor or customer are no longer written to
report_viewed_product_index/report_compared_product_index; the admin customer view shows Online until logout. - Search log — Marketing → SEO & Search → Search Terms, Reports → Search Terms and popular search terms stop updating.
Architecture
around plugins on the core writers return early when their toggle is on; no core class is patched or replaced:
Magento\Customer\Model\Logger::log()Magento\Customer\Model\ResourceModel\Visitor::save()Magento\Reports\Model\ResourceModel\Product\Index\AbstractIndex::save()(rows with no visitor/customer)Magento\Search\Model\Query::saveIncrementalPopularity()andsaveNumResults()
A customer session validator applies the password-change session cutoff (against the login time kept in the
session) to sessions without a customer_visitor row, also after visitor tracking is re-enabled.
Tests: vendor/bin/phpunit -c Test/Unit/phpunit.xml.
