Just found out that [createtokenforuserauto,core_webservice] can only be 40 characters long. It ends up in the field mdl_log.action and that is only 40 chars. The English phrase (Create a token for a user automatically) is 39 chars if I counted right.
If your string is longer then 40 chars, you end up with an error message via email like this:
Insert into log table failed at Sunday 02nd of September 2012 09:27:51 PM.
It is possible that your disk is full.
The failed query parameters are:
array (
'time' => 1346614071,
'userid' => '5052',
'course' => '1',
'ip' => '91.177.224.235',
'module' => 'webservice',
'cmid' => 0,
'action' => 'Maak automatisch een token voor een gebruiker',
'url' => '',
'info' => 'User ID: 5052',
)