Community Documentation

Watchdog: monitor your site

Last updated February 8, 2012. Created by ghankstef on June 29, 2001.
Edited by davidneedham, john@dynapres.nl, cannanso, dman. Log in to edit this page.

Note that starting with Drupal 6.x, Watchdog has been replaced by the dblog and syslog modules. Dblog is similar to watchdog; Syslog allows Drupal's logging to be integrated with the server's syslog facility.

The watchdog module monitors your system and records system events in a log you can review. This helps you get a quick overview of activity on your site. Since the log records events in sequence, it can also be useful for debugging site errors.

The watchdog log records errors, warnings, usage data, performance data, and operational information. You can filter the entries ("Filter by message type") to view only a particular type of message.

You should check the watchdog report regularly to make sure your site is working properly.

You can

  • view watchdog logs at Administer >> Logs >> Recent log entries (admin/logs/watchdog).
  • configure the length of time logs are archived at Administer >> Site configuration >> Error reporting (admin/settings/error-reporting).

For Drupal 6.x

  • view dblog report at Administer >> Reports >> Recent log entries (admin/reports/dblog).
  • configure the row limit for Database logging at Administer >> Site configuration >> Logging and alerts (admin/settings/logging/dblog).

For Drupal 7.x

  • view dblog report at Administration >> Reports >> Recent log messages (admin/reports/dblog).
  • configure the row limit for Database logging at Administration >> Configuration >> Development >> Logging and errors (admin/config/development/logging).

On a shared hosting environment or on a machine that you are not actually the administrator of syslog should never be enabled. The logs would go somewhere you can't see, and may annoy the real administrators who could turn you off. Almost all the time, it's best to use dblog Database logging (the default) instead.

On a dedicated hosting (VPS or dedicated server) enabling Syslog logging will provide a performance boost, as not every log message will have to be written to the database.

You can use Watchdog to debug your code directly to a log (instead of printing it to the page or using devel to print in a message), you can use watchdog(). You can find more information about watchdog on api.drupal.org.

Comments

This message about not using

syslog on a shared host should be on the modules page, next to where one can check the dependencies.

Not seeing the admin/logs/watchdog page.

I get a page not found for the http://mysite/admin/logs/watchdog page (Drupal 6.19)

Re: Not seeing the admin/logs/watchdog page.

Make sure you have the "Database Logging" module installed.
The path is "admin/reports/dblog".

Hope this helps :)

__________________________________
Rob "RCube" Davidson
"In the end, there can be only one." - Juan Ramirez (Highlander)

this helped me .. thank u

this helped me .. thank u

Sachin Gawas | Software Developer | Decos Software Development

Portfolio: www.sachingawas.com | Company: www.decossoftdev.com |