Drupal8: Verbose Error Messages

In beginning to wet my feet with Drupal8 development I ran into this interesting problem as seen in this screenshot:

Oh great, an Error. Egads!

An error that appears upon site installation sometimes.

Is there some way we remedy this problem, or somehow get more information at the problem at hand to debug and fix it?

If you see this message you might be tempted to try and run: cache-rebuild

drush help cache-rebuild
Rebuild a Drupal 8 site and clear all its caches.

Aliases: cr, rebuild

But, this was NOT fixing my problem! How vexing!

After some hunting around I found this useful Drupal 8 Settings configuration value for a websites settings.php file:

// Show all error messages, with backtrace information.
$config["system.logging"]["error_level"] = "verbose";

There is some additional developer information on the Drupal 8 Site Settings file. Additionally, we can see from this Drupal 8 Update script that we can use keyword level log definitions of: hide, some, all, and verbose.

For a production website I recommend setting this value to hide and using your server side webserver logs to log all PHP errors to a file silently. But, as I note above for a development webserver I recommend setting this value to verbose to gleen as much debug information as possible when developing your Drupal 8 site or modules.

By configuring the system.logging value to verbose and refreshing our page we now see the following output which is 100% more helpful. Happy Coding!

A useful debug message with a stacktrace.

A useful debug message with a stacktrace.

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , | Posted under Drupal, Drush | RSS 2.0

Author Spotlight

David Gurba

David Gurba

I am a web programmer currently employed at UCSB. I have been developing web applications professionally for 8+ years now. For the last 5 years I’ve been actively developing websites primarily in PHP using Drupal. I have experience using LAMP and developing data driven websites for clients in aviation, higher education and e-commerce. If you’d like to contact me I can be reached at david.gurba@arvixe.com

Leave a Reply

Your email address will not be published. Required fields are marked *


7 + 5 =

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>