|
|
@@ -40,6 +40,12 @@ class Zend_Log_Writer_ZendMonitor extends Zend_Log_Writer_Abstract
|
|
|
protected $_isEnabled = true;
|
|
|
|
|
|
/**
|
|
|
+ * Is this for a Zend Server intance?
|
|
|
+ * @var bool
|
|
|
+ */
|
|
|
+ protected $_isZendServer = false;
|
|
|
+
|
|
|
+ /**
|
|
|
* @throws Zend_Log_Exception if Zend Monitor extension not present
|
|
|
*/
|
|
|
public function __construct()
|
|
|
@@ -47,6 +53,9 @@ class Zend_Log_Writer_ZendMonitor extends Zend_Log_Writer_Abstract
|
|
|
if (!function_exists('monitor_custom_event')) {
|
|
|
$this->_isEnabled = false;
|
|
|
}
|
|
|
+ if (function_exists('zend_monitor_custom_event')) {
|
|
|
+ $this->_isZendServer = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -103,7 +112,17 @@ class Zend_Log_Writer_ZendMonitor extends Zend_Log_Writer_Abstract
|
|
|
unset($event['priority'], $event['message']);
|
|
|
|
|
|
if (!empty($event)) {
|
|
|
- monitor_custom_event($priority, $message, false, $event);
|
|
|
+ if ($this->_isZendServer) {
|
|
|
+ // On Zend Server; third argument should be the event
|
|
|
+ zend_monitor_custom_event($priority, $message, $event);
|
|
|
+ } else {
|
|
|
+ // On Zend Platform; third argument is severity -- either
|
|
|
+ // 0 or 1 -- and fourth is optional (event)
|
|
|
+ // Severity is either 0 (normal) or 1 (severe); classifying
|
|
|
+ // notice, info, and debug as "normal", and all others as
|
|
|
+ // "severe"
|
|
|
+ monitor_custom_event($priority, $message, ($priority > 4) ? 0 : 1, $event);
|
|
|
+ }
|
|
|
} else {
|
|
|
monitor_custom_event($priority, $message);
|
|
|
}
|