public function testMinimumSetup() { $settings = new Settings(); $settings->setApiKey('953ca95742ee4fd6aab51c3d95c02a2d'); $client = new Client($settings); $log = new Log(); $log->setLogLevel('ERROR'); $log->setMessage('Very bad error'); $client->addLog($log); $this->assertTrue($client->sendLogs()); }
/** * */ protected function _processException() { $client = new Client($this->settings); /* report to be sent */ $report = new Report(); //Setting report parameters $report->setUrl(Request::server()['HTTP_HOST'] . Request::server()['REQUEST_URI']); $report->setServer($this->config['server_name']); $report->setUserAgent(Request::server()['HTTP_USER_AGENT']); $report->setMessage($this->exception->getMessage()); $report->setRequestId($client->getUUID()); $report->setError($this->exception->getMessage()); $report->setHttpStatus($this->exception->getCode()); //Process trace data $this->_processTrace($report); // Set request data $request = new AppEnlightRequest(); $report->setRequest($request); //Send it $client->addReport($report); $client->sendReports(); }