You are here

function gelf_admin_settings_form in GELF 6

Menu callback for GELF admin settings.

1 string reference to 'gelf_admin_settings_form'
gelf_menu in ./gelf.module
Implementation of hook_menu()

File

./gelf.module, line 104
gelf.module

Code

function gelf_admin_settings_form() {
  $form = array();
  $form['gelf_host'] = array(
    '#type' => 'textfield',
    '#title' => t('Graylog2 host'),
    '#default_value' => variable_get('gelf_host', 'localhost'),
  );
  $form['gelf_port'] = array(
    '#type' => 'textfield',
    '#title' => t('Graylog2 GELF port'),
    '#default_value' => variable_get('gelf_port', 12201),
  );
  $gelflib_path = libraries_get_path('gelf-php');
  if (!file_exists($gelflib_path . '/GELFMessage.php') || !file_exists($gelflib_path . '/GELFMessagePublisher.php')) {
    drupal_set_message(t('GELF module requires the GELF PHP library to be installed.  View the README for installation instructions.'), 'error');
  }
  return system_settings_form($form);
}