Exemple #1
0
 public function pushError($error)
 {
     $di = DI::getDefault();
     if (isset($di['request'])) {
         $error['url'] = $di['request']->getHttpHost() . $di['request']->getUri();
     }
     if (isset($di['local']->rawData['service'])) {
         $error['callinfo'] = json_encode($di['local']->rawData);
         if ($di['local']->rawData['service'] == 'Api\\Services\\Monitor') {
             return;
         }
     }
     $error['app'] = Monitor::getProject();
     $error['serverip'] = sprintf("%u\n", ip2long(Monitor::getLocalip()));
     $di['remote']->swooleCall(array('service' => 'Api\\Services\\Monitor', 'method' => 'addlog', 'args' => array($error)));
 }
Exemple #2
0
 private function pushError($rawData, $error)
 {
     $di = \Phalcon\DI::getDefault();
     if (isset($di['request'])) {
         $error['url'] = $di['request']->getHttpHost() . $di['request']->getUri();
     }
     $error['callinfo'] = json_encode($rawData);
     $error['app'] = Monitor::getProject();
     $error['serverip'] = sprintf("%u\n", ip2long(Monitor::getLocalip()));
     $this->swooleCall(array('service' => 'Api\\Services\\Monitor', 'method' => 'addlog', 'args' => array($error)));
 }