

Just to note, that the log entry is added to the database with the placeholders, it is only when the message is output into a UI or similar that the placeholders are rendered with the specified values. The below example is using placeholders that when rendered will be replaced with the value from an array that maps values to placeholders. You can also output arrays and objects in a prettier/ more readable manner too, you just need to concatenate pre tags to your output.

'Email injection exploit attempted in email form subject: '. The below example adds in the contents of a variable and sets the severity to the WATCHDOG_NOTICE constant.

watchdog('my_module', 'my error message')
#Drupal logs code#
$link A link to associate with the message.Īs shown in the code below, the minimum you need is the type and message.
