|
|
@@ -116,7 +116,11 @@ class CubeHandler extends AbstractProcessingHandler
|
|
|
$data['data'] = $record['context'];
|
|
|
$data['data']['level'] = $record['level'];
|
|
|
|
|
|
- $this->{'write'.$this->scheme}(json_encode($data));
|
|
|
+ if ($this->scheme === 'http') {
|
|
|
+ $this->writeHttp(json_encode($data));
|
|
|
+ } else {
|
|
|
+ $this->writeUdp(json_encode($data));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private function writeUdp($data)
|
|
|
@@ -140,6 +144,8 @@ class CubeHandler extends AbstractProcessingHandler
|
|
|
'Content-Length: ' . strlen('['.$data.']'))
|
|
|
);
|
|
|
|
|
|
- return curl_exec($this->httpConnection);
|
|
|
+ if (curl_exec($this->httpConnection) === false) {
|
|
|
+ throw new \RuntimeException(sprintf('Curl error (code %s): %s', curl_errno($ch), curl_error($ch)));
|
|
|
+ }
|
|
|
}
|
|
|
}
|