本文整理汇总了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);
}
}