Skip to main content
1 of 2
greg_1_anderson
  • 21.4k
  • 2
  • 38
  • 47

This is working for me, using the latest Drush dev-master:

drush @dev ev 'watchdog("system", "test watchdog message.");'

What I am doing here is just calling the 'watchdog' function directly with the php-eval command, after bootstrapping a dev site. This should produce the same results as a watchdog function called from a module, and in fact I see the message logged in the Drupal admin/reports/dblog page.

Drush does install a watchdog handler, so that it can log the watchdog messages to the console in addition to the dblog page; however, many of these messages are ignored by Drush as uninteresting. To see the full range of watchdog messages that Drush sees, set the --watchdog flag to 'print':

drush @dev --watchdog=print ev 'watchdog("system", "another watchdog message.");'

You should see this message printed in the console, and it should also appear in the dblog page.

I'm not sure why you are not seeing anything in your dblog page, but you might try upgrading Drush (if you're running an old version), and try some of these commands and see what results you get. This should give you some indication of where the problem is, at least.

greg_1_anderson
  • 21.4k
  • 2
  • 38
  • 47