Errors are the part of developer coding journey and they also improve us as developer.
A good developer always read the error carefully and find the solution for the same so let’s see how we can see error log in Magento.
Where you can find the error log
The log files are located in the <magento-root>/var/log/ folder.
By default, Magento2 writes to the debug log (<magento-root>/var/log/debug.log
) when it is in default or develop mode, but not when it is in production mode.
Enable error log
Use the
command to change the default value.
&& bin/magento c:fbin/magento setup:config:set --enable-debug-logging
=true
Disable error log
Use the
command to change the default value
&& bin/magento c:fbin/magento setup:config:set --enable-debug-logging
=false
Before Magento 2.3.1 enable error log
Use the
command to change the default value
1 && bin/magento c:fbin/magento
config:set dev/debug/debug_logging
Happy debugging 😀