From 7d388de9b1df6196e4da172a1b15478154f982c3 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 12 Aug 2010 21:32:31 +0000 Subject: - Patch #881540 by bjaspan: syslog.module should support openlog() identity argument. --- modules/syslog/syslog.module | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module index 36f25f03d..590dd9dae 100644 --- a/modules/syslog/syslog.module +++ b/modules/syslog/syslog.module @@ -39,6 +39,12 @@ function syslog_help($path, $arg) { function syslog_form_system_logging_settings_alter(&$form, &$form_state) { if (defined('LOG_LOCAL0')) { $help = module_exists('help') ? ' ' . l(t('More information'), 'admin/help/syslog') . '.' : NULL; + $form['syslog_identity'] = array( + '#type' => 'textfield', + '#title' => t('Syslog identity'), + '#default_value' => variable_get('syslog_identity', 'drupal'), + '#description' => t('A string that will be prepended to every message logged to Syslog. If you have multiple sites logging to the same Syslog log file, a unique identity per site makes it easy to tell the log entries apart.') . $help, + ); $form['syslog_facility'] = array( '#type' => 'select', '#title' => t('Syslog facility'), @@ -85,7 +91,7 @@ function syslog_watchdog(array $log_entry) { if (!$log_init) { $log_init = TRUE; $default_facility = defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER; - openlog('drupal', LOG_NDELAY, variable_get('syslog_facility', $default_facility)); + openlog(variable_get('syslog_identity', 'drupal'), LOG_NDELAY, variable_get('syslog_facility', $default_facility)); } $message = strtr(variable_get('syslog_format', '!base_url|!timestamp|!type|!ip|!request_uri|!referer|!uid|!link|!message'), array( -- cgit v1.2.3