You are here

function elasticsearch_watchdog_settings in Elasticsearch Connector 7

Same name and namespace in other branches
  1. 7.5 modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc \elasticsearch_watchdog_settings()
  2. 7.2 modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc \elasticsearch_watchdog_settings()

Building a settings form for the Elasticsearch watchdog functionality.

Return value

array Settings form

1 string reference to 'elasticsearch_watchdog_settings'
elasticsearch_watchdog_menu in modules/elasticsearch_watchdog/elasticsearch_watchdog.module
Implements hook_menu().

File

modules/elasticsearch_watchdog/elasticsearch_watchdog.admin.inc, line 16
Created on Jan 06, 2014

Code

function elasticsearch_watchdog_settings() {
  $form = array();
  $form['#old_cluster_id'] = variable_get('elasticsearch_watchdog_cluster_id', array());
  $form['elasticsearch_watchdog_cluster_id'] = array(
    '#type' => 'ec_index',
    '#title' => t('Select cluster'),
    '#required' => TRUE,
    '#default_value' => variable_get('elasticsearch_watchdog_cluster_id', array()),
    '#description' => t('Select the settings in order to be able to hold the logs.'),
  );
  $form['elasticsearch_watchdog_type'] = array(
    '#type' => 'textfield',
    '#title' => t('Type name'),
    '#required' => TRUE,
    '#element_validate' => array(
      'elasticsearch_connector_validate_type_field',
    ),
    '#default_value' => variable_get('elasticsearch_watchdog_type', ELASTICSEARCH_WATCHDOG_DEFAULT_TYPE),
    '#description' => t('Enter the elasticsearch type name you want to store the logs'),
  );
  $form['elasticsearch_watchdog_types_view'] = array(
    '#type' => 'textfield',
    '#title' => t('Types for view page'),
    '#required' => TRUE,
    '#default_value' => variable_get('elasticsearch_watchdog_types_view', 'watchdog_message'),
    '#description' => t('Comma separated list of watchdog types you want to monitor.'),
  );
  $form['#validate'] = array(
    'elasticsearch_watchdog_settings_validate',
  );
  return system_settings_form($form);
}