diff --git a/modules/system.rules.inc b/modules/system.rules.inc index fcd4f80..ed64a7d 100644 --- a/modules/system.rules.inc +++ b/modules/system.rules.inc @@ -124,6 +124,26 @@ function rules_system_action_info() { 'base' => 'rules_action_drupal_message', 'access callback' => 'rules_system_integration_access', ), + 'drupal_watchdog' => array( + 'label' => t('Log a db watchdog message'), + 'group' => t('System'), + 'parameter' => array( + 'message' => array( + 'type' => 'text', + 'label' => t('Message'), + 'translatable' => TRUE, + ), + 'severity' => array( + 'type' => 'token', + 'label' => t('Severity'), + 'options list' => 'watchdog_severity_levels', + 'default value' => WATCHDOG_NOTICE, + 'optional' => TRUE, + ), + ), + 'base' => 'rules_action_drupal_watchdog', + 'access callback' => 'rules_system_integration_access', + ), 'redirect' => array( 'label' => t('Page redirect'), 'group' => t('System'), diff --git a/modules/system.eval.inc b/modules/system.eval.inc index a27225f..c22fcf9 100644 --- a/modules/system.eval.inc +++ b/modules/system.eval.inc @@ -16,6 +16,13 @@ function rules_action_drupal_message($message, $status, $repeat) { } /** + * Action: Write a watchdog db log message. + */ +function rules_action_drupal_watchdog($message, $severity) { + watchdog('Rules - custom', $message, array(), $severity); +} + +/** * Action: Page redirect. * * @see rules_page_build()