mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-01 10:50:21 +02:00
Auto-close streams when reset() is called, fixes #1862
This commit is contained in:
@@ -79,6 +79,20 @@ class StreamHandler extends AbstractProcessingHandler
|
||||
$this->useLocking = $useLocking;
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function reset(): void
|
||||
{
|
||||
parent::reset();
|
||||
|
||||
// auto-close on reset to make sure we periodically close the file in long running processes
|
||||
// as long as they correctly call reset() between jobs
|
||||
if ($this->url !== null && $this->url !== 'php://memory') {
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
Reference in New Issue
Block a user