Calls to watchdog() sometime fail to add anything to the log. Depending on your system, you might get something like 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 written to your system log instead. This occurs on mysql when sql_mode=STRICT_ALL_TABLES.

One potential fix is shown in the patch attached. That is to call substr() in a way that ensures the string is no longer than the database column intended to contain it. Currently this is 128, but should be increased to 255 or more.

Every varchar column in the table should probably be subject to the same substr() treatment. And increased to 255 or more. I leave it as an exercise for the reader to write that patch. ;)

CommentFileSizeAuthor
dblog_referer.diff344 bytesDave Cohen

Comments

dave reid’s picture

Status: Active » Closed (duplicate)