How to Enable Magento Error Log

How to Enable Magento Error Log

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:

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

Thank You.

5
(based on 8 Reviews)

Sanjay is a co-founder at Meetanshi. He is a certified Magento developer who loves creating Magento E-commerce solutions. When he is not engrossed with anything related to Magento, he loves to play cricket.

2 comments On How to Enable Magento Error Log

  • Syed Muneeb Ul Hasan

    Thank you for sharing the process for Magento 1.x. However, it would be great if you can also include the method for Magento 2.x.

    • Thank you.
      Also, to enable error log in Magento 2, you only need to run a single command which is already mentioned in the blog.

Leave a Reply