function LoggingForm::buildForm

Same name in other branches
  1. 8.9.x core/modules/system/src/Form/LoggingForm.php \Drupal\system\Form\LoggingForm::buildForm()
  2. 10 core/modules/system/src/Form/LoggingForm.php \Drupal\system\Form\LoggingForm::buildForm()
  3. 11.x core/modules/system/src/Form/LoggingForm.php \Drupal\system\Form\LoggingForm::buildForm()

Overrides ConfigFormBase::buildForm

File

core/modules/system/src/Form/LoggingForm.php, line 32

Class

LoggingForm
Configure logging settings for this site.

Namespace

Drupal\system\Form

Code

public function buildForm(array $form, FormStateInterface $form_state) {
    $config = $this->config('system.logging');
    $form['error_level'] = [
        '#type' => 'radios',
        '#title' => $this->t('Error messages to display'),
        '#default_value' => $config->get('error_level'),
        '#options' => [
            ERROR_REPORTING_HIDE => $this->t('None'),
            ERROR_REPORTING_DISPLAY_SOME => $this->t('Errors and warnings'),
            ERROR_REPORTING_DISPLAY_ALL => $this->t('All messages'),
            ERROR_REPORTING_DISPLAY_VERBOSE => $this->t('All messages, with backtrace information'),
        ],
        '#description' => $this->t('It is recommended that sites running on production environments do not display any errors.'),
    ];
    return parent::buildForm($form, $form_state);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.