1.20.x system.admin.inc | system_logging_settings($form, &$form_state) |
Form builder; Configure error reporting settings.
See also
system_logging_settings_validate()
Related topics
File
- modules/
system/ system.admin.inc, line 1620 - Admin page callbacks for the System module.
Code
function system_logging_settings($form, &$form_state) {
$site_config = config('system.core');
$form['#config'] = 'system.core';
$form['error_level'] = array(
'#type' => 'radios',
'#title' => t('Error messages to display'),
'#default_value' => $site_config->get('error_level'),
'#options' => array(
ERROR_REPORTING_HIDE => t('None'),
ERROR_REPORTING_DISPLAY_SOME => t('Errors and warnings'),
ERROR_REPORTING_DISPLAY_ALL => t('All messages'),
),
'#description' => t('It is recommended that sites running on production environments do not display any errors.'),
);
$form['watchdog_enabled_severity_levels'] = array(
'#type' => 'checkboxes',
'#title' => t('Severity of messages to log'),
'#options' => array(
WATCHDOG_EMERGENCY => t('Emergency'),
WATCHDOG_ALERT => t('Alert'),
WATCHDOG_CRITICAL => t('Critial'),
WATCHDOG_ERROR => t('Error'),
WATCHDOG_WARNING => t('Warning'),
WATCHDOG_NOTICE => t('Notice'),
WATCHDOG_INFO => t('Info'),
WATCHDOG_DEBUG => t('Debug'),
WATCHDOG_DEPRECATED => t('Deprecated'),
),
'#default_value' => $site_config->get('watchdog_enabled_severity_levels'),
'#description' => t('The <em>debug</em> and <em>deprecated</em> severity levels are recommended for developer environments, but not on production sites.'),
);
return system_settings_form($form);
}