diff --git a/modules/system.eval.inc b/modules/system.eval.inc index 32a4a88..e1f32d1 100644 --- a/modules/system.eval.inc +++ b/modules/system.eval.inc @@ -16,6 +16,14 @@ function rules_action_drupal_message($message, $status, $repeat) { } /** + * Action: Create a watchdog entry. + */ +function rules_action_watchdog($type, $message, $severity, $link) { + watchdog($type, $message, array(), $severity, $link); +} + + +/** * Action: Page redirect. * * @see rules_page_build() diff --git a/modules/system.rules.inc b/modules/system.rules.inc index f9cf195..d12a730 100644 --- a/modules/system.rules.inc +++ b/modules/system.rules.inc @@ -124,6 +124,31 @@ function rules_system_action_info() { 'base' => 'rules_action_drupal_message', 'access callback' => 'rules_system_integration_access', ), + 'watchdog' => array( + 'label' => t('Log a system message'), + 'group' => t('System'), + 'parameter' => array( + 'type' => array( + 'type' => 'text', + 'label' => t('The category to which this message belongs'), + ), + 'message' => array( + 'type' => 'text', + 'label' => ('Log message'), + ), + 'severity' => array( + 'type' => 'integer', + 'label' => t('Severity'), + 'options list' => 'watchdog_severity_levels', + ), + 'link' => array( + 'type' => 'text', + 'label' => t('An associated, HTML formatted link'), + ), + ), + 'base' => 'rules_action_watchdog', + 'access callback' => 'rules_system_integration_access', + ), 'redirect' => array( 'label' => t('Page redirect'), 'group' => t('System'),