You are here

function dblog_form_system_logging_settings_alter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/dblog/dblog.module \dblog_form_system_logging_settings_alter()

Implements hook_form_FORM_ID_alter() for system_logging_settings().

File

core/modules/dblog/dblog.module, line 97
System monitoring and logging for administrators.

Code

function dblog_form_system_logging_settings_alter(&$form, FormStateInterface $form_state) {
  $row_limits = array(
    100,
    1000,
    10000,
    100000,
    1000000,
  );
  $form['dblog_row_limit'] = array(
    '#type' => 'select',
    '#title' => t('Database log messages to keep'),
    '#default_value' => \Drupal::configFactory()
      ->getEditable('dblog.settings')
      ->get('row_limit'),
    '#options' => array(
      0 => t('All'),
    ) + array_combine($row_limits, $row_limits),
    '#description' => t('The maximum number of messages to keep in the database log. Requires a <a href=":cron">cron maintenance task</a>.', array(
      ':cron' => \Drupal::url('system.status'),
    )),
  );
  $form['#submit'][] = 'dblog_logging_settings_submit';
}