Down-n-dirty with Drupal Watchdog

I am dealing with some really wierd issues that need to be fixed.  The error is:

Attempt to assign property of non-object in /opt/sites/breilabs.com/dev/client/modules/node/node.module on line 1820.

In order to figure out what is going on, I am going use watchdog and start editing the core modules and basically trace my way through the problem.

First off, get a sql client and connect to your drupal db.  This will return your watchdog entries

select * from watchdog order by timestamp desc

In the various php modules that you have, you can add a call to watchdog:

   watchdog('node', 'debugging', array(), WATCHDOG_ERROR);
   watchdog('node', 'debugging 2', $node->nid, WATCHDOG_ERROR);

 

 

Comments

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options