本文整理匯總了PHP中monitor_custom_event函數的典型用法代碼示例。如果您正苦於以下問題:PHP monitor_custom_event函數的具體用法?PHP monitor_custom_event怎麽用?PHP monitor_custom_event使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了monitor_custom_event函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: handle
/**
* Handle the error.
*
* @param string $errorMessage
* @param string $debugMessage
*/
public function handle($errorMessage, $debugMessage)
{
if ($this->zendPlatformAvailable()) {
// log in zend platform
$errMsg = implode(' | ', is_array($errorMessage) ? $errorMessage : array());
if ($errMsg == '') {
$errMsg = 'Something went terribly wrong, but there is no errormessage set...';
} else {
$errMsg = preg_replace('/\\[\\+.*s\\]/', '', $errMsg);
}
// get rid of timestamps because they will prevent ZP from finding duplicate errors
monitor_custom_event(Tools::atktext('app_title'), $errMsg, true);
}
}
示例2: doWrite
/**
* Write a message to the log.
*
* @param array $event log data event
* @return void
*/
protected function doWrite(array $event)
{
$priority = $event['priority'];
$message = $event['message'];
unset($event['priority'], $event['message']);
if (!empty($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);
}
}
示例3: _write
/**
* Write a message to the log.
*
* @param array $event log data event
* @return void
*/
protected function _write($event)
{
$priority = $event['priority'];
$message = $event['message'];
unset($event['priority'], $event['message']);
if (!empty($event)) {
monitor_custom_event($priority, $message, false, $event);
} else {
monitor_custom_event($priority, $message);
}
}