Enabling Logging for Matrix Rate and Product Rate
Enable and troubleshoot debug logging for accurate shipping rate calculations in Magento
Table of Contents
Overview
When using WSA MatrixRate or ProductRate in Magento, requests and responses are logged into the debug log. These logs help diagnose why rates may not have been generated. 😊
Enabling Debug Logging
You can enable the debug log in Magento 2 using two methods. Before proceeding, check your site's mode by navigating to your Magento app directory (where index.php is located) in the shell and entering: php bin/magento deploy:mode:show
. If it says "production," only the command line method is available. Otherwise, the admin panel method is also an option. 💡
Enabling via the Admin Panel
- Navigate to "Stores" → "Configuration" → "Advanced" → "Developer" → "Debug" → "Log to File."
- Set this to "Yes" to log debug information to
var/log/debug.log
in your Magento application directory.
After saving the setting, you might see a prompt to flush the cache. If prompted, flush the Magento cache using the provided link. Note that this option is normally hidden when production mode is enabled, so only use this if you're testing. ⚠️
Enabling via Command Line
- Open the Magento application directory (where index.php is located) in the shell.
To enable debug logging, enter:
php bin/magento config:set dev/debug/debug_logging 1 && php bin/magento cache:flush
This command logs debug information to var/log/debug.log
. To disable debug logging, use:
```shell
php bin/magento config:set dev/debug/debug_logging 0 && php bin/magento cache:flush
Matrix Rate
If issues arise with the Matrix Rate extension, visit this troubleshooting document. It provides steps for installation and resolving extension-related issues. 🔍