class LoggingForm
Same name and namespace in other branches
- 11.x core/modules/system/src/Form/LoggingForm.php \Drupal\system\Form\LoggingForm
Configure logging settings for this site.
@internal
Hierarchy
- class \Drupal\Core\Form\FormBase extends \Drupal\Core\Form\FormInterface, \Drupal\Core\DependencyInjection\ContainerInjectionInterface uses \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Logger\LoggerChannelTrait, \Drupal\Core\Messenger\MessengerTrait, \Drupal\Core\Routing\RedirectDestinationTrait, \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Core\Form\ConfigFormBase uses \Drupal\Core\Form\ConfigFormBaseTrait implements \Drupal\Core\Form\FormBase
- class \Drupal\system\Form\LoggingForm implements \Drupal\Core\Form\ConfigFormBase
- class \Drupal\Core\Form\ConfigFormBase uses \Drupal\Core\Form\ConfigFormBaseTrait implements \Drupal\Core\Form\FormBase
Expanded class hierarchy of LoggingForm
2 string references to 'LoggingForm'
- router_test.routing.yml in core/
modules/ system/ tests/ modules/ router_test_directory/ router_test.routing.yml - core/modules/system/tests/modules/router_test_directory/router_test.routing.yml
- system.routing.yml in core/
modules/ system/ system.routing.yml - core/modules/system/system.routing.yml
File
-
core/
modules/ system/ src/ Form/ LoggingForm.php, line 13
Namespace
Drupal\system\FormView source
class LoggingForm extends ConfigFormBase {
/**
* {@inheritdoc}
*/
public function getFormId() {
return 'system_logging_settings';
}
/**
* {@inheritdoc}
*/
protected function getEditableConfigNames() {
return [
'system.logging',
];
}
/**
* {@inheritdoc}
*/
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);
}
/**
* {@inheritdoc}
*/
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->config('system.logging')
->set('error_level', $form_state->getValue('error_level'))
->save();
parent::submitForm($form, $form_state);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.