diff options
Diffstat (limited to 'engine/lib/system_log.php')
-rw-r--r-- | engine/lib/system_log.php | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/engine/lib/system_log.php b/engine/lib/system_log.php index b500c573b..71996c8b3 100644 --- a/engine/lib/system_log.php +++ b/engine/lib/system_log.php @@ -257,6 +257,21 @@ return false;
return true;
+ } + + /** + * Default system log handler, allows plugins to override, extend or disable logging. + * + * @param string $event + * @param string $object_type + * @param Loggable $object + * @return unknown + */ + function system_log_default_logger($event, $object_type, $object) + { + system_log($object['object'], $object['event']); + + return true; }
/**
@@ -265,16 +280,20 @@ *
* @param String $event
* @param String $object_type
- * @param mixed $object
+ * @param Loggable $object
*/
function system_log_listener($event, $object_type, $object)
- {
- system_log($object, $event);
+ { + if (($object_type!='systemlog') && ($event!='log'))
+ trigger_elgg_event('log', 'systemlog', array('object' => $object, 'event' => $event));
return true;
}
/** Register event to listen to all events **/
- register_elgg_event_handler('all','all','system_log_listener', 400);
+ register_elgg_event_handler('all','all','system_log_listener', 400); + + /** Register a default system log handler */ + register_elgg_event_handler('log','systemlog','system_log_default_logger', 999);
?>
\ No newline at end of file |