summaryrefslogtreecommitdiff
path: root/modules/syslog/syslog.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-08-12 21:32:31 +0000
committerDries Buytaert <dries@buytaert.net>2010-08-12 21:32:31 +0000
commit7d388de9b1df6196e4da172a1b15478154f982c3 (patch)
tree1798c3a4ee9368c1f292140c5e269a8647eb3ef8 /modules/syslog/syslog.module
parente3450c8125333ad840b1aa87340d9713c9b5a518 (diff)
downloadbrdo-7d388de9b1df6196e4da172a1b15478154f982c3.tar.gz
brdo-7d388de9b1df6196e4da172a1b15478154f982c3.tar.bz2
- Patch #881540 by bjaspan: syslog.module should support openlog() identity argument.
Diffstat (limited to 'modules/syslog/syslog.module')
-rw-r--r--modules/syslog/syslog.module8
1 files changed, 7 insertions, 1 deletions
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(