Magento How To Show Full Error Message Instead of Truncated One

Magento How To Show Full Error Message Instead of Truncated One

July 4, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento How To Show Full Error Message Instead of Truncated One

Solving Magento Error Message Truncation: A Comprehensive Guide

As an experienced developer for e-commerce platforms, I’ve encountered this issue many times. Magento has a default setting that truncates error messages, which can make debugging challenging. Let me guide you through the process of displaying full error messages in your Magento store.

Understanding the Problem: Magento’s Error Handling Mechanisms

By default, when an error occurs in Magento, it applies a PHP error handler (mageCoreErrorHandler) to generate user-friendly messages. However, this function truncates long error messages to fit within 500 characters, represented by the […] at the end of your log entry.

The truncation happens because Magento wants to avoid exposing sensitive information or very long stack traces to end-users and search engine crawlers. While this is a security feature, it can hinder your development work when trying to diagnose complex issues.

The Solution: Configuring Magento to Show Complete Error Messages

To enable full error messages in your Magento store, you need to make changes at the configuration level. Here’s a step-by-step guide:

Step 1: Locate the Configuration File

Open the app/etc/local.xml file using a text editor or an FTP client.

Step 2: Find the Tag and Add the Nested Tags

Look for the <global> tag in this file. If it doesn’t exist, add one under the opening <config> tag:

<config>
    <!-- ... other config tags ... -->
    <global>
        ...
    </global>
</config>

Step 3: Add the Error Reporting Configuration

Within the <global> tag, add the following nested <error> and <report> tags:

<global>
    ...
    <error>
        <log_format>1</log_format>
        <log_level>4</log_level>
        <log_directory>/var/log/</log_directory>
        <log_file_ignore>false</log_file_ignore>
    </error>

    <report>
        <module active="true">Mage_Core</module>
        <module active="true">Mage_PageCache</module>
        <module active="true">Mage_Varien</module>
        <module active="false">Mage_Db</module> <!-- Disabled in this example -->
    </report>
</global>

Step 4: Save the Configuration File

After you’ve added these changes, save the local.xml file.

Verifying and Testing the Changes

To ensure your configuration is working:

  1. Visit a page on your Magento store that triggers an error.
  2. Check the var/log/ folder for new error log files (e.g., system.log).

If the configuration was successful, you should see long error messages without truncation in these log files.

Best Practices and Further Reading

Remember to enable full error messages only during development or debugging stages. For production environments, it’s essential to revert to Magento’s default behavior to maintain security.

For more advanced tuning of Magento’s error reporting system, consider using tools like the Mage_Log and Mage_Core_Model_Log_Adapter classes. You can find detailed documentation on these in the official Magento developer documentation.

Conclusion

Displaying full error messages in Magento requires a simple configuration change but yields significant benefits during development and debugging processes.

By following this guide, you’ll gain more detailed insights into your store’s operations and be able to resolve issues more efficiently. Always remember the importance of maintaining security best practices when adjusting these settings in a live environment.

Happy coding! Let me know if you have any other questions about Magento configuration or e-commerce development in general.

Security Configuration Errors CLI

Our network