1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * @file
- * An alternate Drupal logger using Redis.
- *
- * Storage model and logic differ from http://drupal.org/project/redis_watchdog
- */
- use Redis\Logger\Entry;
- use Redis\Logger\Writer;
- /**
- * Implements hook_xautoload().
- */
- function redis_logger_xautoload($api) {
- $api->absolute()->addPsr4('Redis\Logger\\', __DIR__ . '/lib/Redis/Logger');
- }
- /**
- * Implements hook_menu().
- */
- function redis_logger_menu() {
- $items = array();
- $items['admin/reports/redis/logger'] = array(
- 'title' => 'Recent log messages in Redis',
- 'description' => 'View events that have recently been logged.',
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('redis_logger_form_overview'),
- 'access arguments' => array('access site reports'),
- 'weight' => -1,
- 'file' => 'redis_logger.admin.inc',
- );
- $items['admin/reports/redis/logger/%'] = array(
- 'title' => 'Details',
- 'page callback' => 'redis_logger_page_event',
- 'page arguments' => array(4),
- 'access arguments' => array('access site reports'),
- 'file' => 'redis_logger.admin.inc',
- );
- return $items;
- }
- /**
- * Implements hook_watchdog().
- */
- function redis_logger_watchdog(array $log_entry) {
- $writer = Writer::instance();
- $writer->log(new Entry($log_entry));
- }
|