🔥 Just Launched! Werra Premium Template for HyväSee it in Action

How to Enable Magento Error Log

By Sanjay JethvaUpdated on Jan 02, 2025 3 min read

It is frustrating when errors don’t leave your code

Even more, you don’t know what is going wrong and where!

Been there?

Me too.

The Magento, by default, does not keep a track of errors and exceptions. However, you can always enable Magento error log to debug the issues. It is a way to tell Magento to save the error logs, which can be later used to audit and solve the errors!

Method to Enable Magento Error Log:

1. Log in to admin panel

2. Navigate to System > Configuration > Advanced > Developer

3. Enable the option of Log Settings

4. Save

1_Log Settings

Note: Grant the full permission, i.e., 777 to the folder /var/log where log files are stored.

How to Find the Magento Error Log File:

Now that you know how to enable Magento error log file, learn how to find that file too!

The log files are located in the <magento-folder>/var/log/ folder.

If you do not find the log files here, check if the folder is given the writing permission. If not, the web servers won’t be able to create the log files.

The primary files are system.log with all PHP warnings and issues with XML files and exception.log with all the exceptional cases when Magento fails to handle data for any reason.

That’s all about the Magento error logs you need to know.

However, a few key takeaways. Make sure the errors are hidden in the production mode. Do check the Apache logs as well.

If you are a Magento 2 store owner, the entire process becomes easy for you! Just run a single command:

php bin/magento config:set dev/debug/debug_logging

Keep your logs empty, your Magento site healthy, and customers happy! 

Thank You.

Sanjay Jethva Full Image
Article bySanjay Jethva

Sanjay is the co-founder and CTO of Meetanshi with hands-on expertise with Magento since 2011. He specializes in complex development, integrations, extensions, and customizations. Sanjay is one the top 50 contributor to the Magento community and is recognized by Adobe. His passion for Magento 2 and Shopify solutions has made him a trusted source for businesses seeking to optimize their online stores. He loves sharing technical solutions related to Magento 2 & Shopify.