/** * Speichert die Daten des Requests * @param string $rpcmethod * @param string $rpcid * @param string $rpcversion * @param array $requestparams */ public function request($rpcmethod, $rpcid, $rpcversion, array $requestparams) { $configBlacklist = new Dragon_Application_Config('dragonx/log/blacklist'); $configBlacklistArray = $configBlacklist->toArray(); foreach ($requestparams as $name => &$param) { if (in_array($name, $configBlacklistArray)) { $param = ''; } } unset($param); self::$_recordRequest = new DragonX_Log_Record_Request(array('rpcmethod' => $rpcmethod, 'rpcid' => $rpcid, 'rpcversion' => $rpcversion, 'requestparams' => Zend_Json::encode($requestparams), 'requesttimestamp' => time())); $configEngine = new Dragon_Application_Config('dragonx/log/engine'); Zend_Registry::get($configEngine->engine)->save(self::$_recordRequest); if (Zend_Registry::isRegistered('Zend_Log')) { $logger = Zend_Registry::get('Zend_Log'); $logger->setEventItem('request_id', self::$_recordRequest->id); } }
/** * Loggt nach jedem Request die Response und den Responsetimestamp * @param Dragon_Json_Server_Request_Http $request * @param Dragon_Json_Server_Response_Http $response */ public function postDispatch(Dragon_Json_Server_Request_Http $request, Dragon_Json_Server_Response_Http $response) { $logicRequest = new DragonX_Log_Logic_Request(); $logicRequest->response($response->toArray()); }