I want to hide all error messages to the users. I did all the three steps below

  1. Set display_errors = off and error_reporting = 32767 in php.ini
  2. Made sure this config $config['system.logging']['error_level'] = 'verbose'; not exist in settings.php
  3. Admin->Configuration->Development->Logging and Errors -> set None for Error messages to display config.

Still it is showing all the errors, but on first time load only (E.g If there was an error in previous page, those errors are displayed in current page. If i do refresh, those errors are gone from the pages).

How really can hide all the error messages in Drupal 8? I just want to log the messages not to display.

  • Isn't that a 500 error? – Kevin Jun 21 '18 at 2:57
  • yes it is. But i want to hide that error also to user. Do i need to do anything else to hide that? – siddiq Jun 21 '18 at 2:59
  • The only thing I can think of for a 500 error is (if you are using Apache) setting a custom 500 error file to display that doesn't look like a 500 error. How else should the stack react to this? – Kevin Jun 21 '18 at 3:43
  • What is the setting do you have on /admin/config/development/logging ? – No Sssweat Jun 21 '18 at 6:09
  • I have set as None. – siddiq Jun 21 '18 at 18:18

Drupal 8 hide error messages by default unless you enable dev mode.

Check and remove services.yml and settings.local.php files in sites/default folder.

  • What should be removed from services.yml file? I know I need to remove $config['system.logging']['error_level']='verbose'; from settings.php file. But could you help me on what changes has to be done in services.yml file? – siddiq Jul 2 '18 at 5:05
  • Set debug to false or just remove files if it there. – Cong Nguyen Jul 4 '18 at 8:19

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.