本文整理汇总了PHP中zend_monitor_custom_event函数的典型用法代码示例。如果您正苦于以下问题:PHP zend_monitor_custom_event函数的具体用法?PHP zend_monitor_custom_event怎么用?PHP zend_monitor_custom_event使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zend_monitor_custom_event函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: indexAction
public function indexAction()
{
$params = ZendJobQueue::getCurrentJobParams();
if (isset($params['obj'])) {
$obj = unserialize(base64_decode($params['obj']));
if ($obj instanceof ZendServer_JobQueue_Job_Abstract) {
try {
$obj->run();
ZendJobQueue::setCurrentJobStatus(ZendJobQueue::OK);
exit;
} catch (Exception $e) {
zend_monitor_set_aggregation_hint(get_class($obj) . ': ' . $e->getMessage());
zend_monitor_custom_event('Failed Job', $e->getMessage());
}
}
}
ZendJobQueue::setCurrentJobStatus(ZendJobQueue::FAILED);
exit;
}
开发者ID:kschroeder,项目名称:ZendServer-JobQueue-Magento-old,代码行数:19,代码来源:IndexController.php
示例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);
}
}
开发者ID:Flesh192,项目名称:magento,代码行数:27,代码来源:ZendMonitor.php
示例3: writeZendMonitorCustomEvent
/**
* Write a record to Zend Monitor
*
* @param int $level
* @param string $message
* @param array $formatted
*/
protected function writeZendMonitorCustomEvent($level, $message, $formatted)
{
zend_monitor_custom_event($level, $message, $formatted);
}
开发者ID:TeamOfMalaysia,项目名称:H,代码行数:11,代码来源:ZendMonitorHandler.php
示例4: createCustomEvent
/**
* Create a custom event in Zend Server
*
* @param MvcEvent $e
* @return void
*/
public function createCustomEvent(MvcEvent $e)
{
// Do nothing if no error in the event
$error = $e->getError();
if (empty($error)) {
return;
}
// Do nothing if the result is a response object
$result = $e->getResult();
if ($result instanceof Response) {
return;
}
switch ($error) {
case Application::ERROR_CONTROLLER_NOT_FOUND:
case Application::ERROR_CONTROLLER_INVALID:
case Application::ERROR_ROUTER_NO_MATCH:
// Specifically not handling these
return;
case Application::ERROR_EXCEPTION:
default:
if (!empty($e)) {
$exception = $e->getParam('exception');
/* @var $exception \Exception */
$message = 'An error occurred during execution: ' . $exception->getMessage();
if ($this->isCustomEventByRuleIsEnabled()) {
zend_monitor_custom_event_ex('Zend Framework Exception', $message, 'Zend Framework Exception Rule');
} elseif ($this->isCustomEventIsEnabled) {
zend_monitor_custom_event('Zend Framework Exception', $message);
}
}
}
}
开发者ID:ruslan-g,项目名称:zf2,代码行数:38,代码来源:ZendMonitorExceptionStrategy.php
注:本文中的zend_monitor_custom_event函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论