Seldaek / monolog

Sends your logs to files, sockets, inboxes, databases and various web services
https://seldaek.github.io/monolog/
MIT License
21.05k stars 1.9k forks source link

ProcessHandler: Make timeout of `stream_select()` configurable #1916

Closed ericemmrich closed 1 month ago

ericemmrich commented 1 month ago

In our application, any request has always been blocked for 1 second and made it significantly slower. Rather than needing to overwrite almost the entire class with a custom implementation, it would be nice to have this timeout configurable.

ericemmrich commented 1 month ago

@Seldaek What would be required to move this forward? :)

Seldaek commented 1 month ago

Do you use ProcessHandler in prod? What for? Just out of curiosity sorry..

Anyway the PR seems fine so I'll merge but I'll need some more free time before I can triage other stuff and tag a release.

ericemmrich commented 1 month ago

Do you use ProcessHandler in prod? What for? Just out of curiosity sorry..

Anyway the PR seems fine so I'll merge but I'll need some more free time before I can triage other stuff and tag a release.

No worries, thanks for picking this up! :)

We use the ProcessHandler for redirecting some logs to the stderr of process ID 1, so that they are displayed properly in the container logs:

            'handler' => \Monolog\Handler\ProcessHandler::class,
            'with' => [
                'command' => 'cat >> /proc/1/fd/2',
            ],
Seldaek commented 1 month ago

Alright, thanks