[development] watchdog() does not always work - or am I missingsomething?

Dave Cohen drupal at dave-cohen.com
Wed Apr 22 16:51:40 UTC 2009


Good call Frédéric.  I just found messages in my /var/log/messages.log...

query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES(1, 'php', '<em>Data too long for column 'referer' at row 1

I recently added sql_mode=STRICT_ALL_TABLES to my.cnf, in order to catch issues like this in my own modules.  And that's the setting that tells mysql to fail rather than truncate the long values.

-Dave


On Tuesday 21 April 2009 23:16:02 Frédéric G. MARAND wrote:
> I've seen a similar case, where watchdog wouldn't work because the referer 
> field was too long and the insert request in dblog failed almost silently 
> instead of truncating that field (innodb engine, not checked with myisam 
> engine): the request wasn't logged and the failure of that request wasn't 
> stored either, IIRC for the same reason. Had to see it in a debugger to 
> understand what was going on. You might want to try a debugger too.
> 


More information about the development mailing list