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

StreamHandler: Missing close() method #6

Open
Fneufneu opened this issue Dec 9, 2024 · 0 comments
Open

StreamHandler: Missing close() method #6

Fneufneu opened this issue Dec 9, 2024 · 0 comments

Comments

@Fneufneu
Copy link

Fneufneu commented Dec 9, 2024

Hi,

When i rotate my log, i send a SIGHUP signal to inform my daemon so i can $logger->close() and force Monolog to free and reopen all handlers.
But the class Amp\Log\StreamHandler miss the close() method, the write method does not check the validity of the stream before writting, and StreamHandler cannot close and reopen a stream.

Workaround: i remove the StreamHandler from handlers and make a new one.
But the stream is not closed (lsof show my old log is still opened by php)

But i think a simple close() method is needed to close() the stream like it's done in Monolog\Handler\StreamHandler
and documented in Monolog\Handler\HandlerInterface.

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

No branches or pull requests

1 participant