Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Rules provides several actions on behalf of core modules. For system we have drupal_message, redirect, mail etc but one common action missing from this list is drupal_watchdog. It is very useful to have the ability for a user rule to write to the db log. It just requires an extra entry in the rules_system_action_info() array in /modules/system.rules.inc and the corresponding function added to /modules/system.eval.inc
Patch coming up.
Comment | File | Size | Author |
---|---|---|---|
#2 | 2170013_2.rules_watchdog_action.patch | 2.52 KB | jonathan1055 |
Comments
Comment #1
jonathan1055 CreditAttribution: jonathan1055 commentedPatch against 7.x-2.6
The message category is currently fixed at 'Rules - custom' but this could be changed to a user text entry parameter.
Comment #2
jonathan1055 CreditAttribution: jonathan1055 commentedHere is an enhanced version, with the ability to specify the message identifier (column 1 in the dblog) and also to provide a link for the final column. Patch against 7.x-2.7
Comment #3
hargobindThere is an older thread at #1349882: Action: Create a watchdog entry where this feature is being discussed. Please merge your changes into that thread.
P.S. I like the configurability of the message identifier and link text in your patch.
Comment #4
TR CreditAttribution: TR commentedI posted patch #2 to #1349882: Action: Create a watchdog entry in comment #34, as it is better than the patch that was being considered there. Please participate in that discussion to get this fixed!
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks for moving the patch, and for the credit on that issue. There are more participants there, which is good.