Seldaek/monolog · error · LogicException
Unable to connect to {host}:{port}
Error message
Unable to connect to {host}:{port} What it means
Error "Unable to connect to {host}:{port}" thrown in Seldaek/monolog.
Source
Thrown at src/Monolog/Handler/CubeHandler.php:101
throw new \LogicException('Unable to connect to the socket at ' . $this->host . ':' . $this->port);
}
}
/**
* Establish a connection to an http server
*
* @throws \LogicException when unable to connect to the socket
* @throws MissingExtensionException when no curl extension
*/
protected function connectHttp(): void
{
if (!\extension_loaded('curl')) {
throw new MissingExtensionException('The curl extension is required to use http URLs with the CubeHandler');
}
$httpConnection = curl_init('http://'.$this->host.':'.$this->port.'/1.0/event/put');
if (false === $httpConnection) {
throw new \LogicException('Unable to connect to ' . $this->host . ':' . $this->port);
}
$this->httpConnection = $httpConnection;
curl_setopt($this->httpConnection, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($this->httpConnection, CURLOPT_RETURNTRANSFER, true);
}
/**
* @inheritDoc
*/
protected function write(LogRecord $record): void
{
$date = $record->datetime;
$data = ['time' => $date->format('Y-m-d\TH:i:s.uO')];
$context = $record->context;
if (isset($context['type'])) {View on GitHub (pinned to 57eb102834)
When it happens
Trigger: Thrown at src/Monolog/Handler/CubeHandler.php:101 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Seldaek/monolog@57eb102834 (2026-08-17).
Data as JSON: /api/errors/a7542d61a604cb2a.
Report an issue: GitHub.