Skip to content
Snippets Groups Projects
Commit f957cc7b authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#881540 by bjaspan: make syslog identity configurable on the user interface...

#881540 by bjaspan: make syslog identity configurable on the user interface (instead of hardwired to 'drupal')
parent 540b3454
No related branches found
No related tags found
No related merge requests found
<?php
// $Id$
/**
* @file
* Install, update and uninstall functions for the syslog module.
*/
/**
* Implements hook_uninstall().
*/
function syslog_uninstall() {
variable_del('syslog_identity');
variable_del('syslog_facility');
variable_del('syslog_format');
}
......@@ -38,6 +38,13 @@ function syslog_menu() {
}
function syslog_admin_settings() {
$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. For more information on syslog, see <a href="@syslog_help">Syslog help</a>.', array(
'@syslog_help' => url('admin/help/syslog'))),
);
$form['syslog_facility'] = array(
'#type' => 'select',
'#title' => t('Send events to this syslog facility'),
......@@ -73,7 +80,7 @@ function syslog_watchdog($entry) {
if (!$log_init) {
$log_init = TRUE;
openlog('drupal', LOG_NDELAY, variable_get('syslog_facility', DEFAULT_SYSLOG_FACILITY));
openlog(variable_get('syslog_identity', 'drupal'), LOG_NDELAY, variable_get('syslog_facility', DEFAULT_SYSLOG_FACILITY));
}
syslog($entry['severity'], theme('syslog_format', $entry));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment