3 namespace Drupal\system\Form;
5 use Drupal\Core\Form\ConfigFormBase;
6 use Drupal\Core\Form\FormStateInterface;
9 * Configure logging settings for this site.
13 class LoggingForm extends ConfigFormBase {
18 public function getFormId() {
19 return 'system_logging_settings';
25 protected function getEditableConfigNames() {
26 return ['system.logging'];
32 public function buildForm(array $form, FormStateInterface $form_state) {
33 $config = $this->config('system.logging');
34 $form['error_level'] = [
36 '#title' => t('Error messages to display'),
37 '#default_value' => $config->get('error_level'),
39 ERROR_REPORTING_HIDE => t('None'),
40 ERROR_REPORTING_DISPLAY_SOME => t('Errors and warnings'),
41 ERROR_REPORTING_DISPLAY_ALL => t('All messages'),
42 ERROR_REPORTING_DISPLAY_VERBOSE => t('All messages, with backtrace information'),
44 '#description' => t('It is recommended that sites running on production environments do not display any errors.'),
47 return parent::buildForm($form, $form_state);
53 public function submitForm(array &$form, FormStateInterface $form_state) {
54 $this->config('system.logging')
55 ->set('error_level', $form_state->getValue('error_level'))
58 parent::submitForm($form, $form_state);