forked from Gizra/logs_http
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlogs_http.admin.inc
54 lines (46 loc) · 1.49 KB
/
logs_http.admin.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/**
* @file
* Logs HTTP module admin page.
*/
/**
* Logs HTTP POST API Configuration Form.
*/
function logs_http_admin_settings($form, &$form_state) {
$form['logs_http_enabled'] = array(
'#type' => 'checkbox',
'#title' => t('Logs HTTP API'),
'#description' => t('Enable Logs HTTP POST'),
'#default_value' => variable_get('logs_http_enabled', TRUE),
);
$form['logs_http_url'] = array(
'#type' => 'textfield',
'#title' => t('Endpoint'),
'#description' => t('The URL to POST the data to.'),
'#default_value' => variable_get('logs_http_url', NULL),
);
$options = array(
WATCHDOG_EMERGENCY => t('Emergency'),
WATCHDOG_ALERT => t('Alert'),
WATCHDOG_CRITICAL => t('Critical'),
WATCHDOG_ERROR => t('Error'),
WATCHDOG_WARNING => t('Warning'),
WATCHDOG_NOTICE => t('Notice'),
WATCHDOG_INFO => t('Info'),
WATCHDOG_DEBUG => t('Debug'),
);
$form['logs_http_severity_level'] = array(
'#type' => 'select',
'#title' => t('Watchdog Severity'),
'#options' => $options,
'#default_value' => variable_get('logs_http_severity_level', WATCHDOG_ERROR),
'#description' => t('The minimum severity level to be reached before an event is pushed to Logs.'),
);
$form['logs_http_uuid'] = array(
'#type' => 'textfield',
'#title' => t('Unique ID'),
'#description' => t('An arbitrary ID that will identify the environment.'),
'#default_value' => variable_get('logs_http_uuid'),
);
return system_settings_form($form);
}