The Easiest Way to Debug Drupal Themes and Modules

| Drupal
The Easiest Way to Debug Drupal Themes and Modules

Are you looking for an easy way to find errors thrown by your Drupal modules and themes?

A lot of new developers are learning to create their first Drupal 8 modules or Drupal 8 themes. Often they've made a very small typo or spacing error and are looking for an easy way to debug their mistake.

Follow this tutorial, and you'll quickly be able to see a detailed list of recent errors on your Drupal site.

  • Go to Configuration > "Logging and errors".

The logging and errors link in Drupal

  • Under "Error messages to display", check "All messages".
  • Click "Save configuration".

all messages option for debugging in Drupal

  • Go to Reports > "Recent log messages".

recent log messages in Drupal

  • You'll now be able to see many of the errors that themes and modules are reporting to Drupal:

log messages in Drupal

The Drupal 8 module development and Drupal 8 theme design classes do offer more advanced ways to debug your work, but this approach is a quick and easy way to find important errors.


About the author

Steve is the founder of OSTraining. Originally from the UK, he now lives in Sarasota in the USA. Steve's work straddles the line between teaching and web development.