You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there a reason its this way and not caught gracefully?
The text was updated successfully, but these errors were encountered:
mrtariqkhan
changed the title
SyslogUdpHandler - Call to socket_sendto() throws an Fatal error: uncaught exception if a wrong / unreachable IP is given.
SyslogUdpHandler - Call to socket_sendto() throws a Fatal error: uncaught exception if a wrong / unreachable IP is given.
Nov 22, 2017
indeed it is, the problem is it throws out an unhandeled fatal exception. Which is an issue if the supplied IP or domain name goes down for some reason. In my case its the rsyslogd server which went down and took the whole application down with it.
$handler = new SyslogUdpHandler('192.168.225.3668', 514, LOG_USER, env('LOG_LEVEL', 'DEBUG'));
$handler->setFormatter($lineformatter);
$monolog->pushHandler($handler);
results in
2017/11/22 13:41:45 [error] 1612#1612: *177 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught ErrorException: socket_sendto(): Host lookup failed [-10001]: Unknown host in /home/project/vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php:47
Stack trace:
-0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'socket_sendto()...', '/home/...', 47, Array)
-1 vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php(47): socket_sendto(Resource id #4, '<11>1 2017-11-2...', 274, 0, '192.168.225.564', 514)
-2 vendor/monolog/monolog/src/Monolog/Handler/SyslogUdp/UdpSocket.php(31): Monolog\Handler\SyslogUdp\UdpSocket->send('<11>1 2017-11-2...')
-3 vendor/monolog/monolog/src/Monolog/Handler/SyslogUdpHandler.php(51): Monolog\Handler\SyslogUdp\UdpSocket->write('2017-11-22T13:4...', '<11>1 2017-11-2...')
Is there a reason its this way and not caught gracefully?
The text was updated successfully, but these errors were encountered: