labofgood/module-db-query-log-extended

The module enhances the DB logger functionality, offering the capability to display DB logs in the xlsx format and produce a report analyzing query similarities.

v1.0.4 2023-11-02 09:59 UTC

This package is auto-updated.

Last update: 2024-10-01 00:09:19 UTC


README

Overview

The Labofgood_DbQueryLogExtended module offers enhanced analysis capabilities for the db.log generated using Magento's command:

php bin/magento dev:query-log:enable

This module enriches the standard command functionalities by introducing:

  • Extended information about queries added the record context (request uri or CLI command), record number, UID of process.
  • Capability to export the log to an XLSX file format.
  • A feature to do a similarity analysis of SQL queries and showcase them in a separate XLSX sheet.

Example of the report: image image

Example of the similarity analysis report: image

Prerequisites

  • PHP 8.1 or higher
  • Magento 2.4.5

Dependencies

composer.json includes:

        "magento/module-developer": "100.4.*",
        "shuchkin/simplexlsxgen": "^1.3"

Installation Steps

Please follow the instructions:

  • Run composer require --dev labofgood/module-db-query-log-extended
  • Run bin/magento setup:upgrade

Usage Guide

  • To install, please adhere to the following steps:
php bin/magento dev:query-log:enable
  • Browse the website or initiate a CLI command to populate db.log with queries.
  • Run the following command to transform db.log into a XLSX file
php bin/magento labofgood:dev:query-log:convert-to-report --path_to_file=/var/www/html/var/debug/db.log
  • For grouping similar queries and showcasing them in a separate XLSX sheet, run the following command:
php bin/magento labofgood:dev:query-log:similarity-analysis --path_to_file=/var/www/html/var/debug/db.log
  • When done, deactivate the query log with:
php bin/magento dev:query-log:disable

Uninstallation

To uninstall the module, run: bin/magento module:uninstall Labofgood_DbQueryLogExtended

Credits

Licensing

Copyright © 2023 Anton Abramchenko. All rights reserved.
This software is under the "3-Clause BSD License" license (see source).