function DblogHooks::formSystemLoggingSettingsAlter

Implements hook_form_FORM_ID_alter() for system_logging_settings().

File

core/modules/dblog/src/Hook/DblogHooks.php, line 84

Class

DblogHooks
Hook implementations for dblog.

Namespace

Drupal\dblog\Hook

Code

public function formSystemLoggingSettingsAlter(&$form, FormStateInterface $form_state) : void {
    $row_limits = [
        100,
        1000,
        10000,
        100000,
        1000000,
    ];
    $form['dblog_row_limit'] = [
        '#type' => 'select',
        '#title' => t('Database log messages to keep'),
        '#config_target' => 'dblog.settings:row_limit',
        '#options' => [
            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>.', [
            ':cron' => Url::fromRoute('system.status')->toString(),
        ]),
    ];
}

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