This Magento 2 module tracks JavaScript errors on the frontend of your store and logs them for further debugging. It helps developers and store owners monitor and manage errors related to JavaScript, enhancing troubleshooting efforts.
- Tracks JavaScript errors in the browser.
- Sends logs to the Magento backend for easy access and troubleshooting.
- Configurable logging levels (default is
INFO). - Logs errors in the
/var/log/frontend_js_errors.logfile. - Supports Magento 2.x versions.
You can either clone the repository or download the module as a zip and upload it to your Magento installation.
git clone https://github.com/SyntaxIDK/Magento-2-Frontend-Error-Tracker.gitAlternatively, download the module zip and extract it in the /app directory.
Run the following Magento CLI commands to enable the module:
php bin/magento module:enable Syntaxidk_Tracker
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flushAfter running the commands above, verify that the module has been installed successfully by checking the list of enabled modules:
php bin/magento module:statusYou should see Syntaxidk_Tracker listed as enabled.
The module is enabled by default, and it logs JavaScript errors into the frontend_js_errors.log file located in the /var/log/ directory of your Magento installation. The default logging level is set to INFO.
If you wish to disable the module or modify the logging configuration, you can do so by updating the di.xml and other configuration files in the module.
The log file is stored at:
/var/log/frontend_js_errors.log
This path can be updated if needed. You can customize the path by modifying the Frontend.php file located in app/code/Syntaxidk/Tracker/Logger/Handler/Frontend.php.
The log level for this module is set to INFO by default. You can modify the log level by editing the Frontend.php file within the Handler directory.
Once installed and enabled, the module will automatically start tracking JavaScript errors on the frontend of your Magento store. These errors will be logged into the specified log file (frontend_js_errors.log).
You can review the logs to troubleshoot JavaScript issues and fix them to improve the overall user experience.
- Errors Not Showing in Log File: If you are not seeing errors in the log file, ensure that the Magento log system is working correctly. Check that the file permissions are correct for the
/var/logdirectory. - Module Not Working: Ensure that the module is correctly enabled and that you've flushed the cache after running the necessary Magento CLI commands.
This module is released under the MIT License.