Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Monolog SockerHandler: Uncaught RuntimeException: End-of-file reached, probably we got disconnected (sent 0 of N) #87

Closed
gam6itko opened this issue Nov 8, 2023 · 0 comments · Fixed by #88
Assignees
Labels
Milestone

Comments

@gam6itko
Copy link

gam6itko commented Nov 8, 2023

I use script below for testing. As you see it sends 100 messages. But in buggregator I can see only few.

# socket_handler.php

use Monolog\Formatter\JsonFormatter;
use Monolog\Handler\SocketHandler;

$monolog = new \Monolog\Logger('logger');

$handler = new SocketHandler(
    connectionString: 'tcp:https://buggregator:9913',
);
$handler->setFormatter(new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES));
$monolog->pushHandler($handler);


for ($i = 0; $i <= 100; $i++) {
    $monolog->info("message $i");
    usleep(1_000);
}
 php ./sandbox/socket_handler.php 

Fatal error: Uncaught RuntimeException: End-of-file reached, probably we got disconnected (sent 0 of 145) in /srv/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php:420
Stack trace:
#0 /srv/vendor/monolog/monolog/src/Monolog/Handler/SocketHandler.php(99): Monolog\Handler\SocketHandler->writeToSocket('{"message":"mes...')
...

image

It looks like the bugggregator (rr) is closing the socket for unknown reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants