This article explains how to enable detailed error logging in Drupal 8, 9, and 10.
⚠️ Always disable debug mode after troubleshooting is complete.
Prerequisites
Access to cPanel
Ensure PHP error logging is enabled in cPanel
Completion of the task: 10 minutes
Expertise: advanced
Enable Error Reporting from Admin Panel
Log in to the Drupal Administrator
Navigate to Configuration > Development > Logging and errors
Set Error messages to display to All messages.
Save configuration.
Where to View Logs
Reports > Recent log messages
Stored in database table: watchdog (access via SSH)
# view recent messages
drush ws
drush watchdog:show
drush watchdog:show --count=10
# View a specific log entry in detail
drush ws [ID]
# tail logs
drush watchdog-show --tail
drush watchdog:tail
# Mysql query - display the last 10 entries
SELECT * FROM watchdog ORDER BY wid DESC LIMIT 10;
Enable Verbose Logging via settings.php
Edit sites/default/settings.php file
$config['system.logging']['error_level'] = 'verbose';
Disable Debugging
Set error messages back to None or Errors and warnings after troubleshooting.
