How to Enable Error Log in Magento2.4

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 bin/magento setup:config:set --enable-debug-logging=true && bin/magento c:f command to change the default value.

Disable error log

Use the bin/magento setup:config:set --enable-debug-logging=false && bin/magento c:f command to change the default value

Before Magento 2.3.1 enable error log

Use the bin/magento config:set dev/debug/debug_logging 1 && bin/magento c:f command to change the default value

Happy debugging 😀

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

Leave a Reply

Your email address will not be published.