I was installing Magento 2 and got the following error.

    There has been an error processing your request
    Exception printing is disabled by default for security reasons.
    Error log record number: 354086296325

In Magento 1, I used to rename local.xml.sample to local.xml in errors folder and see the exception on the webpage itself instead of checking the file in var folder. How do I do the same in Magento 2 as I don't see errors folder?

  • check in var/log, var/report ... – uscoding Mar 31 '15 at 4:12
  • Hi, You can use developer mode to enable exception printing in magento 2. By default its set to default mode hence no exception printing. – Bhargav Mehta Dec 5 '15 at 6:41

It's similar to Magento 1, but local.xml.sample is located in pub/errors.

Just rename local.xml.sample to local.xml within pub/errors directory.

| improve this answer | |
  • 6
    use magento developer mode as well php bin/magento deploy:mode:set developer – webkul Jan 13 '16 at 7:14

In Magento 2, local.xml.sample file is located in pub/errors/ You just need to rename local.xml.sample to local.xml enter image description here

Now, the error log will not be generic but detailed like this

You can also turn on developer mode in Magento 2 by entering this line in Magento CLI: php bin/magento deploy:mode:set developer

Referrence source: http://magentoexplorer.com/magento-exception-printing-is-disabled-by-default-for-security-reasons-how-to-fix (This tutorial include both Magento 1 and Magento 2, scroll down you will see Debug for Magento 2)

| improve this answer | |

You can also print exception directly by modifying magento2/pub/errors/report.php file as per below code :

 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.

require_once 'processorFactory.php';

$processorFactory = new \Magento\Framework\Error\ProcessorFactory();
$processor = $processorFactory->createProcessor();
if (isset($reportData) && is_array($reportData)) {

    //Added code
    echo "<pre>";

$response = $processor->processReport();
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.