You are here

function hook_monolog_handler_info in Monolog 7

Same name and namespace in other branches
  1. 6 monolog.api.php \hook_monolog_handler_info()

Defines monolog handlers.

Handlers process the records and write them to various sources such as files remote servers, sockets, etc.

Return value

array An associative array keyed by unique name of the handler. Each handler is an associative array containing:

  • label: The human readable name of the handler displayed in admin pages.
  • description: The description of the handler displayed in admin pages.
  • default settings: An associative array of defaults for the settings defined in the "settings callback".
  • loader callback: The name of the function that loads the handler class. Defaults to `monolog_HANDLER_NAME_handler_loader`.
  • settings callback: The name of the function that adds additional settings to the handler's configuration form. Pass FALSE if no additional settings are required. Defaults to `monolog_HANDLER_NAME_handler_settings`.
  • handler file: The path to the include file containing the loader and settings callbacks. If the module implements hook_monolog_handler_path(), this option defaults to `MODULE_PATH/HANDLER_PATH/HANDLER_NAME.inc`.

See also

https://github.com/Seldaek/monolog#handlers

2 functions implement hook_monolog_handler_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

monolog_gelf_monolog_handler_info in modules/monolog_gelf/monolog_gelf.module
Implements hook_monolog_handler_info().
monolog_monolog_handler_info in ./monolog.monolog.inc
Implements hook_monolog_handler_info().
1 invocation of hook_monolog_handler_info()
monolog_handler_info_load_all in ./monolog.crud.inc
Loads all handler definitions from hook_monolog_handler_info() implementations.

File

./monolog.api.php, line 83
Hooks provided by the Composer Manager module.

Code

function hook_monolog_handler_info() {
  $handlers = array();
  $handlers['stream'] = array(
    'label' => t('Stream Handler'),
    'description' => t('Logs records into any PHP stream, use this for log files.'),
    'default settings' => array(
      'filepath' => 'public://monolog/drupal.log',
    ),
  );
  return $handlers;
}