Dblog module overview
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
About
The Drupal core Database logging (dblog) module monitors your system, capturing system events in a log to be reviewed by an authorized individual at a later time.
This module was previously called Watchdog in D4, & D5.
This is useful for site administrators who want a quick overview of activities on their site. The logs also record the sequence of events, so it can be useful for debugging site errors.
The log is a list of recorded events containing usage data, performance data, errors, warnings and operational information. Administrators should check the Drupal core report on a regular basis to ensure their site is working properly.
Viewing log messages
To view the log, navigate to the Recent log messages page (http://example.com/admin/reports/dblog)
- On the Recent log messages page, click Filter Log Messages
- Select one or more categories from the Type and Severity columns. Hold down the Ctrl key to select more than one item.
- Click Filter
To clear the filters click Filter Log Messages and click Reset.
Viewing log messages when the site is down
To view the log messages when the site is down you need the core syslog module or drush.
The drush command to see log messages is drush wd-show
. Check drush help wd-show for uses of the command. A particular useful way of using wd-show is with the --tail option: drush wd-show --tail
.
Configuring the log
- Navigate to the Logging and Errors configuration page (/admin/config/development/logging)
- In the Errors and Messages section, specify whether messages will be displayed. In production environments, this is generally set to None.
- In the Database Log Entries to Keep field, select the number of log entries to retain in the database. A cron job must run for this setting to be applied.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion