Magento Error log record file isn't created under `/var/report`

Magento Error log record file isn't created under `/var/report`

August 9, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento Error log record file isn't created under `/var/report`

Solving Magento Error Log Issues: A Step-by-Step Guide

If you’re facing issues with your Magento error log not creating files under /var/report, don’t worry—you’ve come to the right place! Let’s dive into this issue and find a solution together.

Understanding the Issue

When an error occurs in your Magento store, it should be logged in the var/report directory. This file contains valuable information about what went wrong, helping you troubleshoot and resolve the problem quickly.

However, if the error log isn’t being created or is inaccessible, you might see a message like this when trying to access the backend:

Exception printing is disabled by default for security reasons.
Error log record number: 148013902355

Why This Happens

There could be several reasons why your error logs are not being created or accessed properly:

  • Permissions issues on the var/report directory
  • Misconfiguration in your Magento settings related to logging
  • Server-level restrictions preventing file creation
  • Incorrect environment configuration (like running in “production mode”)

Step 1: Check PHP Error Reporting Setting

The first step is to ensure that error reporting is enabled in your PHP configuration. You can do this by adding the following lines to your php.ini file or creating a .user.ini file in your root directory:

display_errors = On
error_reporting = E_ALL | E_STRICT
log_errors = On
error_log = /path/to/your/log/file.log

Remember to replace /path/to/your/log/file.log with the actual path where you want to store the error logs.

Step 2: Enable Developer Mode and Display Errors in Magento

Next, let’s enable developer mode in your Magento installation. This will allow you to see detailed error messages instead of generic exceptions.

Open the index.php file located in your project root directory. Comment out or remove the following lines near the top:

//if (isset($_SERVER['MAGE_IS_DEVELOPER_MODE'])) {
//    Mage::setIsDeveloperMode(true);
//}

Then, comment out or uncomment this line right below it:

ini_set('display_errors', 1);

This will enable Magento to display errors directly on the screen rather than logging them.

Step 3: Check File Permissions and Ownership

Sometimes, the issue lies in file permissions. The var/report directory needs to have write access for the web server user (usually apache or www-data).

Run the following commands:

chmod -R 777 var
chown -R apache:apache var

This will give full read-write-execute permissions to the var directory and its contents, ensuring that error logs can be created.

Step 4: Flush Cache

If all else fails, try flushing your Magento cache. This can sometimes resolve issues with logging and file creation.

php -f shell/indexer.php reindexall
rm -rf var/cache/*

Conclusion

By following these steps, you should now be able to view the error logs in your var/report directory and identify what’s causing the issue on your Magento site. Don’t forget to revert any changes made to the php.ini file or .user.ini file after troubleshooting.

For more advanced troubleshooting techniques and best practices for Magento development, be sure to check out our comprehensive guides at Laravel Company. We have a wealth of resources to help you optimize your Magento experience.

Catalog Security API Admin

Our network