summaryrefslogtreecommitdiff
path: root/modules/syslog
diff options
context:
space:
mode:
Diffstat (limited to 'modules/syslog')
-rw-r--r--modules/syslog/syslog.install16
-rw-r--r--modules/syslog/syslog.module28
2 files changed, 30 insertions, 14 deletions
diff --git a/modules/syslog/syslog.install b/modules/syslog/syslog.install
new file mode 100644
index 000000000..feebb6326
--- /dev/null
+++ b/modules/syslog/syslog.install
@@ -0,0 +1,16 @@
+<?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');
+}
diff --git a/modules/syslog/syslog.module b/modules/syslog/syslog.module
index 590dd9dae..20f8a2823 100644
--- a/modules/syslog/syslog.module
+++ b/modules/syslog/syslog.module
@@ -37,14 +37,14 @@ function syslog_help($path, $arg) {
* Implements hook_form_FORM_ID_alter().
*/
function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
+ $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,
+ );
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'),
@@ -52,14 +52,14 @@ function syslog_form_system_logging_settings_alter(&$form, &$form_state) {
'#options' => syslog_facility_list(),
'#description' => t('Depending on the system configuration, Syslog and other logging tools use this code to identify or filter messages from within the entire system log.') . $help,
);
- $form['syslog_format'] = array(
- '#type' => 'textarea',
- '#title' => t('Syslog format'),
- '#default_value' => variable_get('syslog_format', '!base_url|!timestamp|!type|!ip|!request_uri|!referer|!uid|!link|!message'),
- '#description' => t('Specify the format of the syslog entry. Available variables are: <dl><dt><code>!base_url</code></dt><dd>Base URL of the site.</dd><dt><code>!timestamp</code></dt><dd>Unix timestamp of the log entry.</dd><dt><code>!type</code></dt><dd>The category to which this message belongs.</dd><dt><code>!ip</code></dt><dd>IP address of the user triggering the message.</dd><dt><code>!request_uri</code></dt><dd>The requested URI.</dd><dt><code>!referer</code></dt><dd>HTTP Referer if available.</dd><dt><code>!uid</code></dt><dd>User ID.</dd><dt><code>!link</code></dt><dd>A link to associate with the message.</dd><dt><code>!message</code></dt><dd>The message to store in the log.</dd></dl>'),
- );
- $form['actions']['#weight'] = 1;
}
+ $form['syslog_format'] = array(
+ '#type' => 'textarea',
+ '#title' => t('Syslog format'),
+ '#default_value' => variable_get('syslog_format', '!base_url|!timestamp|!type|!ip|!request_uri|!referer|!uid|!link|!message'),
+ '#description' => t('Specify the format of the syslog entry. Available variables are: <dl><dt><code>!base_url</code></dt><dd>Base URL of the site.</dd><dt><code>!timestamp</code></dt><dd>Unix timestamp of the log entry.</dd><dt><code>!type</code></dt><dd>The category to which this message belongs.</dd><dt><code>!ip</code></dt><dd>IP address of the user triggering the message.</dd><dt><code>!request_uri</code></dt><dd>The requested URI.</dd><dt><code>!referer</code></dt><dd>HTTP Referer if available.</dd><dt><code>!uid</code></dt><dd>User ID.</dd><dt><code>!link</code></dt><dd>A link to associate with the message.</dd><dt><code>!message</code></dt><dd>The message to store in the log.</dd></dl>'),
+ );
+ $form['actions']['#weight'] = 1;
}
/**